mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 07:02:39 +00:00
Entropy is now calculated for Custom Alphabets in Password Generator View
Custom String in Password Generator View are now filtered to only include unique characters
This commit is contained in:
@@ -7,8 +7,9 @@
|
||||
//
|
||||
|
||||
#import "KPKLegacyLoadingTest.h"
|
||||
#import "KPKTreeCryptor.h"
|
||||
#import "KPKTree+Serializing.h"
|
||||
#import "KPKPassword.h"
|
||||
#import "KPKErrors.h"
|
||||
|
||||
@implementation KPKLegacyLoadingTest
|
||||
|
||||
@@ -24,10 +25,19 @@
|
||||
_password = nil;
|
||||
}
|
||||
|
||||
- (void)testLoading {
|
||||
KPKTreeCryptor *cryptor = [KPKTreeCryptor treeCryptorWithData:_data password:_password];
|
||||
KPKTree *tree = [cryptor decryptTree:NULL];
|
||||
- (void)testValidFile {
|
||||
KPKTree *tree = [[KPKTree alloc] initWithData:_data password:_password error:NULL];
|
||||
STAssertNotNil(tree, @"Loading should result in a tree object");
|
||||
}
|
||||
|
||||
- (void)testInvalidFile {
|
||||
NSError *error;
|
||||
uint8 bytes[] = {0x00,0x11,0x22,0x33,0x44};
|
||||
NSData *data = [NSData dataWithBytes:bytes length:5];
|
||||
KPKTree *tree = [[KPKTree alloc] initWithData:data password:nil error:&error];
|
||||
STAssertNil(tree, @"Tree should be nil with invalid data");
|
||||
STAssertNotNil(error, @"Error object should have been created");
|
||||
STAssertTrue(KPKErrorUnknownFileFormat == [error code], @"Error should be Unknown file format");
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user