- Timestamp:
- Mar 1, 2010, 8:33:48 PM (15 years ago)
- Branches:
- release-1.5
- Children:
- ccfa7d1
- Parents:
- c4b5de8
- git-author:
- Anders Kaseorg <andersk@mit.edu> (02/07/10 23:16:45)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (03/01/10 20:33:48)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tester.c
rf0f2eec r19b2766 13 13 int owl_obarray_regtest(void); 14 14 int owl_editwin_regtest(void); 15 #ifdef OWL_ENABLE_ZCRYPT 16 int owl_zcrypt_regtest(void); 17 #endif 15 18 16 19 int main(int argc, char **argv, char **env) … … 31 34 numfailures += owl_obarray_regtest(); 32 35 numfailures += owl_editwin_regtest(); 36 #ifdef OWL_ENABLE_ZCRYPT 37 numfailures += owl_zcrypt_regtest(); 38 #endif 33 39 if (numfailures) { 34 40 fprintf(stderr, "# *** WARNING: %d failures total\n", numfailures); … … 355 361 return numfailed; 356 362 } 363 364 #ifdef OWL_ENABLE_ZCRYPT 365 int owl_zcrypt_regtest(void) 366 { 367 int numfailed = 0; 368 char *encrypted, *decrypted; 369 370 printf("# BEGIN testing owl_zcrypt\n"); 371 372 encrypted = owl_zcrypt_encrypt_with_key("Hello, world!", "seekritkey"); 373 FAIL_UNLESS("zcrypt encrypt", strcmp(encrypted, "TLJMKQSIGKSJRIJRSIIPIJFFULKRJSPK") == 0); 374 decrypted = owl_zcrypt_decrypt_with_key(encrypted, "seekritkey"); 375 FAIL_UNLESS("zcrypt decrypt", strcmp(decrypted, "Hello, world!") == 0); 376 owl_free(decrypted); 377 owl_free(encrypted); 378 379 printf("# END testing owl_zcrypt (%d failures)\n", numfailed); 380 381 return numfailed; 382 } 383 #endif
Note: See TracChangeset
for help on using the changeset viewer.