Monotone-Parent: 2fb9aaf01f9b4a29e3d49d6c35deaf48a4e57e9c

Monotone-Revision: 825d6255230167e6f80d8015a569afa6bdb4cb7d

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-04-16T15:24:16
This commit is contained in:
Wolfgang Sourdeau
2012-04-16 15:24:16 +00:00
parent 10bfd70be1
commit 6aa627a800
4 changed files with 114 additions and 0 deletions
+23
View File
@@ -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