Fixed Tests

Fixed error that lead to trying to create and array with nil object
This commit is contained in:
michael starke
2013-07-13 00:00:51 +02:00
parent 860d6bb21c
commit a31e287ec8
12 changed files with 182 additions and 39 deletions

View File

@@ -20,9 +20,9 @@
MPDocument *document = [[MPDocument alloc] initWithContentsOfURL:url ofType:@"kdb" error:&error];
STAssertNil(error, @"No Error should occur on loading");
STAssertNotNil(document, @"Document cannot be nil");
STAssertFalse(document.isDecrypted, @"Document is not decrypted after inital load");
STAssertTrue([document decryptWithPassword:@"1234" keyFileURL:nil], @"Should decrypt with password");
STAssertTrue(document.isDecrypted, @"Document is decrypted if decryptiong succeeds");
STAssertFalse(document.decrypted, @"Document is not decrypted after inital load");
STAssertTrue([document unlockWithPassword:@"1234" keyFileURL:nil], @"Should decrypt with password");
STAssertTrue(document.decrypted, @"Document is decrypted if decryptiong succeeds");
STAssertNotNil(document.treeV3, @"Tree shoudl be version1");
STAssertNil(document.treeV4, @"Tree should not be version2");
STAssertTrue(document.version == MPDatabaseVersion3, @"Internal databse version should be correct");
@@ -35,9 +35,9 @@
MPDocument *document = [[MPDocument alloc] initWithContentsOfURL:url ofType:@"kdb" error:&error];
STAssertNil(error, @"No Error should occur on loading");
STAssertNotNil(document, @"Document should not be nil");
STAssertFalse(document.isDecrypted, @"Document is not decrypted after inital load");
STAssertFalse([document decryptWithPassword:@"123" keyFileURL:nil], @"Decryption should fail");
STAssertFalse(document.isDecrypted, @"Document is not decrypted with wrong password supplied");
STAssertFalse(document.decrypted, @"Document is not decrypted after inital load");
STAssertFalse([document unlockWithPassword:@"123" keyFileURL:nil], @"Decryption should fail");
STAssertFalse(document.decrypted, @"Document is not decrypted with wrong password supplied");
}
- (void)testLoadDatabaseVerions2 {
@@ -47,9 +47,9 @@
MPDocument *document = [[MPDocument alloc] initWithContentsOfURL:url ofType:@"kdbx" error:&error];
STAssertNil(error, @"No Error should occur on loading");
STAssertNotNil(document, @"Document cannot be nil");
STAssertFalse(document.isDecrypted, @"Document is not decrypted after inital load");
STAssertTrue([document decryptWithPassword:@"1234" keyFileURL:nil], @"Should decrypt with password");
STAssertTrue(document.isDecrypted, @"Document is decrypted if decryptiong succeeds");
STAssertFalse(document.decrypted, @"Document is not decrypted after inital load");
STAssertTrue([document unlockWithPassword:@"1234" keyFileURL:nil], @"Should decrypt with password");
STAssertTrue(document.decrypted, @"Document is decrypted if decryptiong succeeds");
STAssertNil(document.treeV3, @"Tree should not be version1");
STAssertNotNil(document.treeV4, @"Tree shoud be version2");
STAssertTrue(document.version == MPDatabaseVersion4, @"Internal database version should be correct");