From 3d95ea21fa92fe859eb14781c44185c5da4a62b9 Mon Sep 17 00:00:00 2001 From: Matt Ronge Date: Thu, 31 Jan 2013 20:33:49 -0600 Subject: Start of an Obj-C async API --- tests/main.mm | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/main.mm b/tests/main.mm index 56a270fa..fe1efb2e 100644 --- a/tests/main.mm +++ b/tests/main.mm @@ -270,6 +270,24 @@ static void testAsyncPOP() [[NSRunLoop currentRunLoop] run]; } +void testObjc() +{ + MCOIMAPSession *session = [[MCOIMAPSession alloc] init]; + session.username = @"username"; + session.password = @"password"; + session.hostname = @"imap.gmail.com"; + session.port = 993; + session.connectionType = MCOConnectionTypeTLS; + + [session checkAccount:^(NSError *err, MCOOperation *op, id result) { + NSLog(@"CONNECTED? %@", err); + }]; + + [[NSRunLoop currentRunLoop] run]; + [session release]; +} + + void testAll() { u_setDataDirectory("/usr/local/share/icu"); @@ -286,7 +304,9 @@ void testAll() //testAsyncSMTP(data); //testAsyncIMAP(); //testAsyncPOP(); - + + testObjc(); + MCLog("pool release"); pool->release(); } -- cgit v1.2.3