Changeset 9be80b5
- Timestamp:
- Feb 9, 2010, 9:49:49 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 1f37eba
- Parents:
- ae50abc
- git-author:
- Anders Kaseorg <andersk@mit.edu> (02/07/10 23:16:45)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (02/09/10 21:49:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tester.c
rf7cd7c9 r9be80b5 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) … … 33 36 numfailures += owl_obarray_regtest(); 34 37 numfailures += owl_editwin_regtest(); 38 #ifdef OWL_ENABLE_ZCRYPT 39 numfailures += owl_zcrypt_regtest(); 40 #endif 35 41 if (numfailures) { 36 42 fprintf(stderr, "# *** WARNING: %d failures total\n", numfailures); … … 361 367 return numfailed; 362 368 } 369 370 #ifdef OWL_ENABLE_ZCRYPT 371 int owl_zcrypt_regtest(void) 372 { 373 int numfailed = 0; 374 char *encrypted, *decrypted; 375 376 printf("# BEGIN testing owl_zcrypt\n"); 377 378 encrypted = owl_zcrypt_encrypt_with_key("Hello, world!", "seekritkey"); 379 FAIL_UNLESS("zcrypt encrypt", strcmp(encrypted, "TLJMKQSIGKSJRIJRSIIPIJFFULKRJSPK") == 0); 380 decrypted = owl_zcrypt_decrypt_with_key(encrypted, "seekritkey"); 381 FAIL_UNLESS("zcrypt decrypt", strcmp(decrypted, "Hello, world!") == 0); 382 owl_free(decrypted); 383 owl_free(encrypted); 384 385 printf("# END testing owl_zcrypt (%d failures)\n", numfailed); 386 387 return numfailed; 388 } 389 #endif
Note: See TracChangeset
for help on using the changeset viewer.