mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-19 21:53:19 +00:00
Monotone-Parent: 2fb9aaf01f9b4a29e3d49d6c35deaf48a4e57e9c
Monotone-Revision: 825d6255230167e6f80d8015a569afa6bdb4cb7d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-04-16T15:24:16
This commit is contained in:
@@ -47,4 +47,27 @@
|
||||
failIf(count != 0);
|
||||
}
|
||||
|
||||
- (void) test_encryptdecrypt
|
||||
{
|
||||
NSString *secret = @"this is a secret";
|
||||
NSString *password = @"qwerty";
|
||||
NSString *encresult, *decresult;
|
||||
|
||||
encresult = [secret encryptWithKey: nil];
|
||||
failIf(encresult != nil);
|
||||
encresult = [secret encryptWithKey: @""];
|
||||
failIf(encresult != nil);
|
||||
|
||||
encresult = [secret encryptWithKey: password];
|
||||
failIf(encresult == nil);
|
||||
|
||||
decresult = [encresult decryptWithKey: nil];
|
||||
failIf(decresult != nil);
|
||||
decresult = [encresult decryptWithKey: @""];
|
||||
failIf(decresult != nil);
|
||||
|
||||
decresult = [encresult decryptWithKey: password];
|
||||
failIf(![decresult isEqualToString: secret]);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user