18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
-
+
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#import <ObjFW/ObjFW.h>
#import "MTXClient.h"
#import "ObjMatrix.h"
@interface Tests: OFObject <OFApplicationDelegate>
@end
OF_APPLICATION_DELEGATE(Tests)
@implementation Tests
|
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
+
+
+
+
|
[MTXClient logInWithUser: environment[@"OBJMATRIX_USER"]
password: environment[@"OBJMATRIX_PASS"]
homeserver: homeserver
block: ^ (MTXClient *client, id exception) {
if (exception != nil) {
[of_stdout writeFormat: @"Error logging in: %@\n",
exception];
if ([exception isKindOfClass:
MTXLoginFailedException.class])
[of_stdout writeFormat: @"Response: %@\n",
[exception response]];
[OFApplication terminateWithStatus: 1];
}
[of_stdout writeFormat: @"Logged in client: %@\n", client];
[OFApplication terminate];
}];
}
@end
|