mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 00:02:28 +00:00
Fixed spelling errors in comments and some strings, as well as fixed a compilation error (KPKEntry has no entry key, but does have a name field
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
NSData *colorData = [NSData dataWithBytesNoCopy:&colorBytes length:4 freeWhenDone:NO];
|
||||
NSColor *color = [NSColor colorWithData:colorData];
|
||||
NSData *newData = [color colorData];
|
||||
XCTAssertEqualObjects(colorData, newData, @"Convertion should result in same data");
|
||||
XCTAssertEqualObjects(colorData, newData, @"Conversion should result in same data");
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
- (void)testLegacyKeyfileGeneration {
|
||||
NSData *data = [NSData generateKeyfiledataForVersion:KPKLegacyVersion];
|
||||
// test if strucutre is sound;
|
||||
// test if structure is sound;
|
||||
XCTAssertNotNil(data, @"Keydata should have been generated");
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
XCTAssertNotNil(tree, @"Tree should be created");
|
||||
error = nil;
|
||||
NSData *data = [tree encryptWithPassword:password forVersion:KPKLegacyVersion error:&error];
|
||||
XCTAssertNotNil(data, @"Serialized Data shoudl be created");
|
||||
XCTAssertNotNil(data, @"Serialized Data should be created");
|
||||
NSString *tempFile = [NSTemporaryDirectory() stringByAppendingString:@"CustomIcon_Password_1234.kdb"];
|
||||
NSLog(@"Saved to %@", tempFile);
|
||||
[data writeToFile:tempFile atomically:YES];
|
||||
|
||||
@@ -70,11 +70,11 @@
|
||||
XCTAssertNotNil(copyEntry, @"Copied Entry cannot be nil");
|
||||
XCTAssertTrue([copyEntry.title isEqualToString:entry.title], @"Titles should match");
|
||||
XCTAssertTrue([copyEntry.url isEqualToString:entry.url], @"URLS should match");
|
||||
XCTAssertTrue([copyEntry.binaries count] == 1, @"Binareis should be copied");
|
||||
XCTAssertTrue([copyEntry.binaries count] == 1, @"Binaries should be copied");
|
||||
|
||||
KPKBinary *copiedBinary = [copyEntry.binaries lastObject];
|
||||
XCTAssertTrue([copiedBinary.data isEqualToData:binary.data], @"Binary data should match");
|
||||
XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should macht");
|
||||
XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should match");
|
||||
}
|
||||
|
||||
- (void)testIconCoding {
|
||||
|
||||
@@ -59,11 +59,11 @@
|
||||
XCTAssertNotNil(copyEntry, @"Copied Entry cannot be nil");
|
||||
XCTAssertTrue([copyEntry.title isEqualToString:@"Title"], @"Titles should match");
|
||||
XCTAssertTrue([copyEntry.url isEqualToString:@"URL"], @"URLS should match");
|
||||
XCTAssertTrue([copyEntry.binaries count] == 1, @"Binareis should be copied");
|
||||
XCTAssertTrue([copyEntry.binaries count] == 1, @"Binaries should be copied");
|
||||
|
||||
KPKBinary *copiedBinary = [copyEntry.binaries lastObject];
|
||||
XCTAssertTrue([copiedBinary.data isEqualToData:binary.data], @"Binary data should match");
|
||||
XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should macht");
|
||||
XCTAssertTrue([copiedBinary.name isEqualToString:binary.name], @"Binary names should match");
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
- (void)testUndelemitedUUID {
|
||||
NSUUID *uuid1 = [[NSUUID alloc] initWithUUIDString:@"31C1F2E6-BF71-4350-BE58-05216AFC5AFF"];
|
||||
NSUUID *uuid2 = [[NSUUID alloc] initWithUndelemittedUUIDString:@"31C1F2E6BF714350BE5805216AFC5AFF"];
|
||||
XCTAssertTrue([uuid1 isEqual:uuid2], @"UUIDs shoudl match");
|
||||
XCTAssertTrue([uuid1 isEqual:uuid2], @"UUIDs should match");
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil];
|
||||
NSError *error;
|
||||
KPKTree *tree = [reader tree:&error];
|
||||
XCTAssertNil(tree, @"No Tree form emptry data");
|
||||
XCTAssertNil(tree, @"No Tree from empty data");
|
||||
XCTAssertNotNil(error, @"Error Object should be provided");
|
||||
XCTAssertTrue([error code] == KPKErrorNoData, @"Error Code should be No Data");
|
||||
}
|
||||
@@ -35,7 +35,7 @@
|
||||
KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil];
|
||||
NSError *error;
|
||||
KPKTree *tree = [reader tree:&error];
|
||||
XCTAssertNil(tree, @"No Tree form emptry data");
|
||||
XCTAssertNil(tree, @"No Tree from empty data");
|
||||
XCTAssertNotNil(error, @"Error Object should be provided");
|
||||
XCTAssertTrue([error code] == KPKErrorXMLKeePassFileElementMissing, @"Error Code should be KeePassFile root missing");
|
||||
}
|
||||
@@ -45,7 +45,7 @@
|
||||
KPKXmlTreeReader *reader = [[KPKXmlTreeReader alloc] initWithData:[document XMLData] headerReader:nil];
|
||||
NSError *error;
|
||||
KPKTree *tree = [reader tree:&error];
|
||||
XCTAssertNil(tree, @"No Tree form emptry data");
|
||||
XCTAssertNil(tree, @"No Tree from empty data");
|
||||
XCTAssertNotNil(error, @"Error Object should be provided");
|
||||
XCTAssertTrue([error code] == KPKErrorXMLMetaElementMissing, @"Error Code should be KeePassFile root missing");
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
- (void)testCreateNewDatabase {
|
||||
MPDocument *document = [[MPDocument alloc] init];
|
||||
XCTAssertNotNil(document, @"Document should be created");
|
||||
XCTAssertTrue(document.tree.minimumVersion == KPKLegacyVersion, @"Tree should be Legacy Version in defautl case");
|
||||
XCTAssertTrue(document.tree.minimumVersion == KPKLegacyVersion, @"Tree should be Legacy Version in default case");
|
||||
XCTAssertFalse(document.encrypted, @"Document cannot be encrypted at creation");
|
||||
XCTAssertFalse(document.compositeKey.hasPasswordOrKeyFile, @"Document has no Password/Keyfile and thus is not secured");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user