Changeset 463

Show
Ignore:
Timestamp:
04/10/07 15:41:15
Author:
rachel
Message:

Use a meaningful test name.
Some other tidying up

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openpgpsdk/trunk/tests/tests.c

    r450 r463  
    5656 
    5757    case OPS_PTAG_CT_PK_SESSION_KEY: 
    58         printf ("OPS_PTAG_CT_PK_SESSION_KEY\n"); 
     58               //      printf ("OPS_PTAG_CT_PK_SESSION_KEY\n"); 
    5959        if(decrypter) 
    6060            break; 
     
    118118        else 
    119119            { 
    120             printf ("Couldn't open dir: errno=%d\n", errno); 
     120            fprintf (stderr,"Couldn't open dir: errno=%d\n", errno); 
    121121            perror(NULL); 
    122122            } 
     
    139139        return 1; 
    140140 
    141     printf("creating new file\n"); 
     141       //    printf("creating new file\n"); 
    142142    // Create a new unencrypted test file 
    143143    snprintf(file,MAXBUF,"%s/%s",dir,textfile); 
     
    154154    if ((fd=open(keydetails,O_WRONLY | O_CREAT | O_EXCL, 0600))<0) 
    155155        { 
    156         printf("Can't create key details\n"); 
     156        fprintf(stderr,"Can't create key details\n"); 
    157157        return 1; 
    158158        } 
     
    163163 
    164164    char cmd[MAXBUF+1]; 
    165     snprintf(cmd,MAXBUF,"gpg --gen-key --expert --homedir=%s --batch %s > /dev/null",dir,keydetails); 
     165    snprintf(cmd,MAXBUF,"gpg --gen-key --expert --homedir=%s --batch %s 2>&1 > /dev/null",dir,keydetails); 
    166166    //printf("cmd: %s\n", cmd); 
    167167    system(cmd); 
    168168 
    169169    // Now encrypt the test file with GPG 
    170     snprintf(cmd,MAXBUF,"gpg --encrypt --homedir=%s --recipient Alpha %s > /dev/null", dir, file); 
     170    snprintf(cmd,MAXBUF,"gpg --encrypt --homedir=%s --recipient Alpha %s 2>&1 > /dev/null", dir, file); 
    171171    if (system(cmd)) 
    172172        { 
     
    192192    } 
    193193 
    194 void test1(void) 
     194void test_rsa_decryption(void) 
    195195    { 
    196196    char secring[MAXBUF+1]; 
     
    244244    // add tests to suite 
    245245 
    246     if (NULL == CU_add_test(pSuite, "test 1", test1)) 
     246    if (NULL == CU_add_test(pSuite, "RSA decryption", test_rsa_decryption)) 
    247247        { 
    248248        CU_cleanup_registry();