Changeset d564c3d for tester.c


Ignore:
Timestamp:
Mar 17, 2010, 11:15:36 PM (11 years ago)
Author:
Nelson Elhage <nelhage@ksplice.com>
Branches:
master, release-1.6, release-1.7, release-1.8, release-1.9
Children:
2b7ef0a
Parents:
dfe94f9
git-author:
Nelson Elhage <nelhage@ksplice.com> (03/17/10 22:55:20)
git-committer:
Nelson Elhage <nelhage@ksplice.com> (03/17/10 23:15:36)
Message:
Replace the built-in zcrypt with shelling out to the zcrypt binary.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester.c

    r30bb10a rd564c3d  
    1313int owl_obarray_regtest(void);
    1414int owl_editwin_regtest(void);
    15 #ifdef OWL_ENABLE_ZCRYPT
    16 int owl_zcrypt_regtest(void);
    17 #endif
    1815
    1916int main(int argc, char **argv, char **env)
     
    3633  numfailures += owl_obarray_regtest();
    3734  numfailures += owl_editwin_regtest();
    38 #ifdef OWL_ENABLE_ZCRYPT
    39   numfailures += owl_zcrypt_regtest();
    40 #endif
    4135  if (numfailures) {
    4236      fprintf(stderr, "# *** WARNING: %d failures total\n", numfailures);
     
    367361  return numfailed;
    368362}
    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.