Changeset 463
- Timestamp:
- 04/10/07 15:41:15
- Files:
-
- openpgpsdk/trunk/tests/tests.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openpgpsdk/trunk/tests/tests.c
r450 r463 56 56 57 57 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"); 59 59 if(decrypter) 60 60 break; … … 118 118 else 119 119 { 120 printf ("Couldn't open dir: errno=%d\n", errno);120 fprintf (stderr,"Couldn't open dir: errno=%d\n", errno); 121 121 perror(NULL); 122 122 } … … 139 139 return 1; 140 140 141 printf("creating new file\n");141 // printf("creating new file\n"); 142 142 // Create a new unencrypted test file 143 143 snprintf(file,MAXBUF,"%s/%s",dir,textfile); … … 154 154 if ((fd=open(keydetails,O_WRONLY | O_CREAT | O_EXCL, 0600))<0) 155 155 { 156 printf("Can't create key details\n");156 fprintf(stderr,"Can't create key details\n"); 157 157 return 1; 158 158 } … … 163 163 164 164 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); 166 166 //printf("cmd: %s\n", cmd); 167 167 system(cmd); 168 168 169 169 // 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); 171 171 if (system(cmd)) 172 172 { … … 192 192 } 193 193 194 void test 1(void)194 void test_rsa_decryption(void) 195 195 { 196 196 char secring[MAXBUF+1]; … … 244 244 // add tests to suite 245 245 246 if (NULL == CU_add_test(pSuite, " test 1", test1))246 if (NULL == CU_add_test(pSuite, "RSA decryption", test_rsa_decryption)) 247 247 { 248 248 CU_cleanup_registry();
