diff options
author | DINH Viet Hoa <dinh.viet.hoa@gmail.com> | 2013-02-04 23:01:13 -0800 |
---|---|---|
committer | DINH Viet Hoa <dinh.viet.hoa@gmail.com> | 2013-02-04 23:01:13 -0800 |
commit | b213d77c6864262ca6509240089cd45738dd260f (patch) | |
tree | 4fa59a3bf4a06c9baea903c57a457e4b18797338 /tests/main.mm | |
parent | 7620295ce1cce969f7dced4d19a248f46889fe9b (diff) |
fixed test
Diffstat (limited to 'tests/main.mm')
-rw-r--r-- | tests/main.mm | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/tests/main.mm b/tests/main.mm index 8157408c..8d679917 100644 --- a/tests/main.mm +++ b/tests/main.mm @@ -275,29 +275,33 @@ static void testAsyncPOP() void testObjC() { MCOIMAPSession *session = [[MCOIMAPSession alloc] init]; - session.username = @"monkeybreadr@gmail.com"; - session.password = @""; + session.username = [NSString mco_stringWithMCString:email]; + session.password = [NSString mco_stringWithMCString:password]; session.hostname = @"imap.gmail.com"; session.port = 993; session.connectionType = MCOConnectionTypeTLS; - MCOCheckAccountOperation *checkOp = [session checkAccountOperation]; + NSLog(@"check account"); + MCOCheckAccountOperation *checkOp = [[session checkAccountOperation] retain]; [checkOp start:^(NSError *err) { + NSLog(@"check account done"); if (err) { NSLog(@"Oh crap, an error %@", err); } else { NSLog(@"CONNECTED"); + NSLog(@"fetch all folders"); + MCOFetchFoldersOperation *foldersOp = [[session fetchAllFoldersOperation] retain]; + [foldersOp start:^(NSError *err, NSArray *folders) { + NSLog(@"fetch all folders done"); + if (err) { + NSLog(@"Oh crap, an error %@", err); + } else { + NSLog(@"Folder %@", folders); + } + }]; } }]; - MCOFetchFoldersOperation *foldersOp = [session fetchAllFoldersOperation]; - [foldersOp start:^(NSError *err, NSArray *folders) { - if (err) { - NSLog(@"Oh crap, an error %@", err); - } else { - NSLog(@"Folder %@", folders); - } - }]; [[NSRunLoop currentRunLoop] run]; [session autorelease]; |