Commit f072be032fe921617ba5f78a004ee73c75caf6bd

Authored by Jay Berkenbilt
1 parent 3f9d50b5

qpdf-ctest: outfile2 -> xarg

Showing 1 changed file with 37 additions and 37 deletions
qpdf/qpdf-ctest.c
@@ -136,7 +136,7 @@ static void count_progress(int percent, void* data) @@ -136,7 +136,7 @@ static void count_progress(int percent, void* data)
136 static void test01(char const* infile, 136 static void test01(char const* infile,
137 char const* password, 137 char const* password,
138 char const* outfile, 138 char const* outfile,
139 - char const* outfile2) 139 + char const* xarg)
140 { 140 {
141 qpdf_read(qpdf, infile, password); 141 qpdf_read(qpdf, infile, password);
142 printf("version: %s\n", qpdf_get_pdf_version(qpdf)); 142 printf("version: %s\n", qpdf_get_pdf_version(qpdf));
@@ -174,7 +174,7 @@ static void test01(char const* infile, @@ -174,7 +174,7 @@ static void test01(char const* infile,
174 static void test02(char const* infile, 174 static void test02(char const* infile,
175 char const* password, 175 char const* password,
176 char const* outfile, 176 char const* outfile,
177 - char const* outfile2) 177 + char const* xarg)
178 { 178 {
179 qpdf_set_suppress_warnings(qpdf, QPDF_TRUE); 179 qpdf_set_suppress_warnings(qpdf, QPDF_TRUE);
180 if (((qpdf_read(qpdf, infile, password) & QPDF_ERRORS) == 0) && 180 if (((qpdf_read(qpdf, infile, password) & QPDF_ERRORS) == 0) &&
@@ -189,7 +189,7 @@ static void test02(char const* infile, @@ -189,7 +189,7 @@ static void test02(char const* infile,
189 static void test03(char const* infile, 189 static void test03(char const* infile,
190 char const* password, 190 char const* password,
191 char const* outfile, 191 char const* outfile,
192 - char const* outfile2) 192 + char const* xarg)
193 { 193 {
194 qpdf_read(qpdf, infile, password); 194 qpdf_read(qpdf, infile, password);
195 qpdf_init_write(qpdf, outfile); 195 qpdf_init_write(qpdf, outfile);
@@ -202,7 +202,7 @@ static void test03(char const* infile, @@ -202,7 +202,7 @@ static void test03(char const* infile,
202 static void test04(char const* infile, 202 static void test04(char const* infile,
203 char const* password, 203 char const* password,
204 char const* outfile, 204 char const* outfile,
205 - char const* outfile2) 205 + char const* xarg)
206 { 206 {
207 qpdf_set_ignore_xref_streams(qpdf, QPDF_TRUE); 207 qpdf_set_ignore_xref_streams(qpdf, QPDF_TRUE);
208 qpdf_read(qpdf, infile, password); 208 qpdf_read(qpdf, infile, password);
@@ -215,7 +215,7 @@ static void test04(char const* infile, @@ -215,7 +215,7 @@ static void test04(char const* infile,
215 static void test05(char const* infile, 215 static void test05(char const* infile,
216 char const* password, 216 char const* password,
217 char const* outfile, 217 char const* outfile,
218 - char const* outfile2) 218 + char const* xarg)
219 { 219 {
220 int count = 0; 220 int count = 0;
221 qpdf_read(qpdf, infile, password); 221 qpdf_read(qpdf, infile, password);
@@ -232,7 +232,7 @@ static void test05(char const* infile, @@ -232,7 +232,7 @@ static void test05(char const* infile,
232 static void test06(char const* infile, 232 static void test06(char const* infile,
233 char const* password, 233 char const* password,
234 char const* outfile, 234 char const* outfile,
235 - char const* outfile2) 235 + char const* xarg)
236 { 236 {
237 char* buf = NULL; 237 char* buf = NULL;
238 unsigned long size = 0; 238 unsigned long size = 0;
@@ -249,7 +249,7 @@ static void test06(char const* infile, @@ -249,7 +249,7 @@ static void test06(char const* infile,
249 static void test07(char const* infile, 249 static void test07(char const* infile,
250 char const* password, 250 char const* password,
251 char const* outfile, 251 char const* outfile,
252 - char const* outfile2) 252 + char const* xarg)
253 { 253 {
254 qpdf_read(qpdf, infile, password); 254 qpdf_read(qpdf, infile, password);
255 qpdf_init_write(qpdf, outfile); 255 qpdf_init_write(qpdf, outfile);
@@ -262,7 +262,7 @@ static void test07(char const* infile, @@ -262,7 +262,7 @@ static void test07(char const* infile,
262 static void test08(char const* infile, 262 static void test08(char const* infile,
263 char const* password, 263 char const* password,
264 char const* outfile, 264 char const* outfile,
265 - char const* outfile2) 265 + char const* xarg)
266 { 266 {
267 qpdf_read(qpdf, infile, password); 267 qpdf_read(qpdf, infile, password);
268 qpdf_init_write(qpdf, outfile); 268 qpdf_init_write(qpdf, outfile);
@@ -276,7 +276,7 @@ static void test08(char const* infile, @@ -276,7 +276,7 @@ static void test08(char const* infile,
276 static void test09(char const* infile, 276 static void test09(char const* infile,
277 char const* password, 277 char const* password,
278 char const* outfile, 278 char const* outfile,
279 - char const* outfile2) 279 + char const* xarg)
280 { 280 {
281 qpdf_read(qpdf, infile, password); 281 qpdf_read(qpdf, infile, password);
282 qpdf_init_write(qpdf, outfile); 282 qpdf_init_write(qpdf, outfile);
@@ -289,7 +289,7 @@ static void test09(char const* infile, @@ -289,7 +289,7 @@ static void test09(char const* infile,
289 static void test10(char const* infile, 289 static void test10(char const* infile,
290 char const* password, 290 char const* password,
291 char const* outfile, 291 char const* outfile,
292 - char const* outfile2) 292 + char const* xarg)
293 { 293 {
294 qpdf_set_attempt_recovery(qpdf, QPDF_FALSE); 294 qpdf_set_attempt_recovery(qpdf, QPDF_FALSE);
295 qpdf_read(qpdf, infile, password); 295 qpdf_read(qpdf, infile, password);
@@ -299,7 +299,7 @@ static void test10(char const* infile, @@ -299,7 +299,7 @@ static void test10(char const* infile,
299 static void test11(char const* infile, 299 static void test11(char const* infile,
300 char const* password, 300 char const* password,
301 char const* outfile, 301 char const* outfile,
302 - char const* outfile2) 302 + char const* xarg)
303 { 303 {
304 qpdf_read(qpdf, infile, password); 304 qpdf_read(qpdf, infile, password);
305 qpdf_init_write(qpdf, outfile); 305 qpdf_init_write(qpdf, outfile);
@@ -313,7 +313,7 @@ static void test11(char const* infile, @@ -313,7 +313,7 @@ static void test11(char const* infile,
313 static void test12(char const* infile, 313 static void test12(char const* infile,
314 char const* password, 314 char const* password,
315 char const* outfile, 315 char const* outfile,
316 - char const* outfile2) 316 + char const* xarg)
317 { 317 {
318 qpdf_read(qpdf, infile, password); 318 qpdf_read(qpdf, infile, password);
319 qpdf_init_write(qpdf, outfile); 319 qpdf_init_write(qpdf, outfile);
@@ -329,7 +329,7 @@ static void test12(char const* infile, @@ -329,7 +329,7 @@ static void test12(char const* infile,
329 static void test13(char const* infile, 329 static void test13(char const* infile,
330 char const* password, 330 char const* password,
331 char const* outfile, 331 char const* outfile,
332 - char const* outfile2) 332 + char const* xarg)
333 { 333 {
334 qpdf_read(qpdf, infile, password); 334 qpdf_read(qpdf, infile, password);
335 printf("user password: %s\n", qpdf_get_user_password(qpdf)); 335 printf("user password: %s\n", qpdf_get_user_password(qpdf));
@@ -343,14 +343,14 @@ static void test13(char const* infile, @@ -343,14 +343,14 @@ static void test13(char const* infile,
343 static void test14(char const* infile, 343 static void test14(char const* infile,
344 char const* password, 344 char const* password,
345 char const* outfile, 345 char const* outfile,
346 - char const* outfile2) 346 + char const* xarg)
347 { 347 {
348 qpdf_read(qpdf, infile, password); 348 qpdf_read(qpdf, infile, password);
349 qpdf_init_write(qpdf, outfile); 349 qpdf_init_write(qpdf, outfile);
350 qpdf_set_static_ID(qpdf, QPDF_TRUE); 350 qpdf_set_static_ID(qpdf, QPDF_TRUE);
351 qpdf_set_minimum_pdf_version_and_extension(qpdf, "1.7", 8); 351 qpdf_set_minimum_pdf_version_and_extension(qpdf, "1.7", 8);
352 qpdf_write(qpdf); 352 qpdf_write(qpdf);
353 - qpdf_init_write(qpdf, outfile2); 353 + qpdf_init_write(qpdf, xarg);
354 qpdf_set_static_ID(qpdf, QPDF_TRUE); 354 qpdf_set_static_ID(qpdf, QPDF_TRUE);
355 qpdf_force_pdf_version(qpdf, "1.4"); 355 qpdf_force_pdf_version(qpdf, "1.4");
356 qpdf_write(qpdf); 356 qpdf_write(qpdf);
@@ -360,7 +360,7 @@ static void test14(char const* infile, @@ -360,7 +360,7 @@ static void test14(char const* infile,
360 static void test15(char const* infile, 360 static void test15(char const* infile,
361 char const* password, 361 char const* password,
362 char const* outfile, 362 char const* outfile,
363 - char const* outfile2) 363 + char const* xarg)
364 { 364 {
365 qpdf_read(qpdf, infile, password); 365 qpdf_read(qpdf, infile, password);
366 qpdf_init_write(qpdf, outfile); 366 qpdf_init_write(qpdf, outfile);
@@ -384,7 +384,7 @@ static void print_info(char const* key) @@ -384,7 +384,7 @@ static void print_info(char const* key)
384 static void test16(char const* infile, 384 static void test16(char const* infile,
385 char const* password, 385 char const* password,
386 char const* outfile, 386 char const* outfile,
387 - char const* outfile2) 387 + char const* xarg)
388 { 388 {
389 unsigned long buflen = 0L; 389 unsigned long buflen = 0L;
390 unsigned char const* buf = 0; 390 unsigned char const* buf = 0;
@@ -416,7 +416,7 @@ static void test16(char const* infile, @@ -416,7 +416,7 @@ static void test16(char const* infile,
416 static void test17(char const* infile, 416 static void test17(char const* infile,
417 char const* password, 417 char const* password,
418 char const* outfile, 418 char const* outfile,
419 - char const* outfile2) 419 + char const* xarg)
420 { 420 {
421 qpdf_read(qpdf, infile, password); 421 qpdf_read(qpdf, infile, password);
422 qpdf_init_write(qpdf, outfile); 422 qpdf_init_write(qpdf, outfile);
@@ -433,7 +433,7 @@ static void test17(char const* infile, @@ -433,7 +433,7 @@ static void test17(char const* infile,
433 static void test18(char const* infile, 433 static void test18(char const* infile,
434 char const* password, 434 char const* password,
435 char const* outfile, 435 char const* outfile,
436 - char const* outfile2) 436 + char const* xarg)
437 { 437 {
438 qpdf_read(qpdf, infile, password); 438 qpdf_read(qpdf, infile, password);
439 qpdf_init_write(qpdf, outfile); 439 qpdf_init_write(qpdf, outfile);
@@ -450,7 +450,7 @@ static void test18(char const* infile, @@ -450,7 +450,7 @@ static void test18(char const* infile,
450 static void test19(char const* infile, 450 static void test19(char const* infile,
451 char const* password, 451 char const* password,
452 char const* outfile, 452 char const* outfile,
453 - char const* outfile2) 453 + char const* xarg)
454 { 454 {
455 qpdf_read(qpdf, infile, password); 455 qpdf_read(qpdf, infile, password);
456 qpdf_init_write(qpdf, outfile); 456 qpdf_init_write(qpdf, outfile);
@@ -462,7 +462,7 @@ static void test19(char const* infile, @@ -462,7 +462,7 @@ static void test19(char const* infile,
462 static void test20(char const* infile, 462 static void test20(char const* infile,
463 char const* password, 463 char const* password,
464 char const* outfile, 464 char const* outfile,
465 - char const* outfile2) 465 + char const* xarg)
466 { 466 {
467 qpdf_read(qpdf, infile, password); 467 qpdf_read(qpdf, infile, password);
468 qpdf_init_write(qpdf, outfile); 468 qpdf_init_write(qpdf, outfile);
@@ -477,7 +477,7 @@ static void test20(char const* infile, @@ -477,7 +477,7 @@ static void test20(char const* infile,
477 static void test21(char const* infile, 477 static void test21(char const* infile,
478 char const* password, 478 char const* password,
479 char const* outfile, 479 char const* outfile,
480 - char const* outfile2) 480 + char const* xarg)
481 { 481 {
482 qpdf_read(qpdf, infile, password); 482 qpdf_read(qpdf, infile, password);
483 qpdf_init_write(qpdf, outfile); 483 qpdf_init_write(qpdf, outfile);
@@ -491,7 +491,7 @@ static void test21(char const* infile, @@ -491,7 +491,7 @@ static void test21(char const* infile,
491 static void test22(char const* infile, 491 static void test22(char const* infile,
492 char const* password, 492 char const* password,
493 char const* outfile, 493 char const* outfile,
494 - char const* outfile2) 494 + char const* xarg)
495 { 495 {
496 qpdf_read(qpdf, infile, password); 496 qpdf_read(qpdf, infile, password);
497 qpdf_init_write(qpdf, outfile); 497 qpdf_init_write(qpdf, outfile);
@@ -506,7 +506,7 @@ static void test22(char const* infile, @@ -506,7 +506,7 @@ static void test22(char const* infile,
506 static void test23(char const* infile, 506 static void test23(char const* infile,
507 char const* password, 507 char const* password,
508 char const* outfile, 508 char const* outfile,
509 - char const* outfile2) 509 + char const* xarg)
510 { 510 {
511 QPDF_ERROR_CODE status = 0; 511 QPDF_ERROR_CODE status = 0;
512 qpdf_read(qpdf, infile, password); 512 qpdf_read(qpdf, infile, password);
@@ -518,7 +518,7 @@ static void test23(char const* infile, @@ -518,7 +518,7 @@ static void test23(char const* infile,
518 static void test24(char const* infile, 518 static void test24(char const* infile,
519 char const* password, 519 char const* password,
520 char const* outfile, 520 char const* outfile,
521 - char const* outfile2) 521 + char const* xarg)
522 { 522 {
523 /* This test case is designed for minimal.pdf. Pull objects out of 523 /* This test case is designed for minimal.pdf. Pull objects out of
524 * minimal.pdf to make sure all our accessors work as expected. 524 * minimal.pdf to make sure all our accessors work as expected.
@@ -655,7 +655,7 @@ static void test24(char const* infile, @@ -655,7 +655,7 @@ static void test24(char const* infile,
655 static void test25(char const* infile, 655 static void test25(char const* infile,
656 char const* password, 656 char const* password,
657 char const* outfile, 657 char const* outfile,
658 - char const* outfile2) 658 + char const* xarg)
659 { 659 {
660 /* This test case is designed for minimal.pdf. */ 660 /* This test case is designed for minimal.pdf. */
661 qpdf_read(qpdf, infile, password); 661 qpdf_read(qpdf, infile, password);
@@ -737,7 +737,7 @@ static void test25(char const* infile, @@ -737,7 +737,7 @@ static void test25(char const* infile,
737 static void test26(char const* infile, 737 static void test26(char const* infile,
738 char const* password, 738 char const* password,
739 char const* outfile, 739 char const* outfile,
740 - char const* outfile2) 740 + char const* xarg)
741 { 741 {
742 /* Make sure we detect uninitialized objects */ 742 /* Make sure we detect uninitialized objects */
743 qpdf_data qpdf2 = qpdf_init(); 743 qpdf_data qpdf2 = qpdf_init();
@@ -749,7 +749,7 @@ static void test26(char const* infile, @@ -749,7 +749,7 @@ static void test26(char const* infile,
749 static void test27(char const* infile, 749 static void test27(char const* infile,
750 char const* password, 750 char const* password,
751 char const* outfile, 751 char const* outfile,
752 - char const* outfile2) 752 + char const* xarg)
753 { 753 {
754 /* Exercise a string with a null. Since the regular methods return 754 /* Exercise a string with a null. Since the regular methods return
755 * char*, we can't see past the null character without looking 755 * char*, we can't see past the null character without looking
@@ -767,7 +767,7 @@ static void test27(char const* infile, @@ -767,7 +767,7 @@ static void test27(char const* infile,
767 static void test28(char const* infile, 767 static void test28(char const* infile,
768 char const* password, 768 char const* password,
769 char const* outfile, 769 char const* outfile,
770 - char const* outfile2) 770 + char const* xarg)
771 { 771 {
772 /* This test case is designed for minimal.pdf. */ 772 /* This test case is designed for minimal.pdf. */
773 773
@@ -808,7 +808,7 @@ static void test28(char const* infile, @@ -808,7 +808,7 @@ static void test28(char const* infile,
808 static void test29(char const* infile, 808 static void test29(char const* infile,
809 char const* password, 809 char const* password,
810 char const* outfile, 810 char const* outfile,
811 - char const* outfile2) 811 + char const* xarg)
812 { 812 {
813 /* Trap exceptions thrown by object accessors. Type mismatches are 813 /* Trap exceptions thrown by object accessors. Type mismatches are
814 * errors rather than warnings when they don't have an owning QPDF 814 * errors rather than warnings when they don't have an owning QPDF
@@ -857,7 +857,7 @@ static void test29(char const* infile, @@ -857,7 +857,7 @@ static void test29(char const* infile,
857 static void test30(char const* infile, 857 static void test30(char const* infile,
858 char const* password, 858 char const* password,
859 char const* outfile, 859 char const* outfile,
860 - char const* outfile2) 860 + char const* xarg)
861 { 861 {
862 assert(qpdf_read(qpdf, infile, password) & QPDF_ERRORS); 862 assert(qpdf_read(qpdf, infile, password) & QPDF_ERRORS);
863 /* Fail to handle error */ 863 /* Fail to handle error */
@@ -866,7 +866,7 @@ static void test30(char const* infile, @@ -866,7 +866,7 @@ static void test30(char const* infile,
866 static void test31(char const* infile, 866 static void test31(char const* infile,
867 char const* password, 867 char const* password,
868 char const* outfile, 868 char const* outfile,
869 - char const* outfile2) 869 + char const* xarg)
870 { 870 {
871 /* Make sure type warnings have a specific error code. This test 871 /* Make sure type warnings have a specific error code. This test
872 * case is designed for minimal.pdf. 872 * case is designed for minimal.pdf.
@@ -884,7 +884,7 @@ static void test31(char const* infile, @@ -884,7 +884,7 @@ static void test31(char const* infile,
884 static void test32(char const* infile, 884 static void test32(char const* infile,
885 char const* password, 885 char const* password,
886 char const* outfile, 886 char const* outfile,
887 - char const* outfile2) 887 + char const* xarg)
888 { 888 {
889 /* This test case is designed for minimal.pdf. */ 889 /* This test case is designed for minimal.pdf. */
890 assert(qpdf_read(qpdf, infile, password) == 0); 890 assert(qpdf_read(qpdf, infile, password) == 0);
@@ -897,7 +897,7 @@ static void test32(char const* infile, @@ -897,7 +897,7 @@ static void test32(char const* infile,
897 static void test33(char const* infile, 897 static void test33(char const* infile,
898 char const* password, 898 char const* password,
899 char const* outfile, 899 char const* outfile,
900 - char const* outfile2) 900 + char const* xarg)
901 { 901 {
902 /* This test case is designed for minimal.pdf. */ 902 /* This test case is designed for minimal.pdf. */
903 903
@@ -938,7 +938,7 @@ int main(int argc, char* argv[]) @@ -938,7 +938,7 @@ int main(int argc, char* argv[])
938 char const* infile = 0; 938 char const* infile = 0;
939 char const* password = 0; 939 char const* password = 0;
940 char const* outfile = 0; 940 char const* outfile = 0;
941 - char const* outfile2 = 0; 941 + char const* xarg = 0;
942 void (*fn)(char const*, char const*, char const*, char const*) = 0; 942 void (*fn)(char const*, char const*, char const*, char const*) = 0;
943 943
944 if ((p = strrchr(argv[0], '/')) != NULL) 944 if ((p = strrchr(argv[0], '/')) != NULL)
@@ -969,7 +969,7 @@ int main(int argc, char* argv[]) @@ -969,7 +969,7 @@ int main(int argc, char* argv[])
969 infile = argv[2]; 969 infile = argv[2];
970 password = argv[3]; 970 password = argv[3];
971 outfile = argv[4]; 971 outfile = argv[4];
972 - outfile2 = (argc > 5 ? argv[5] : 0); 972 + xarg = (argc > 5 ? argv[5] : 0);
973 973
974 fn = ((n == 1) ? test01 : 974 fn = ((n == 1) ? test01 :
975 (n == 2) ? test02 : 975 (n == 2) ? test02 :
@@ -1013,7 +1013,7 @@ int main(int argc, char* argv[]) @@ -1013,7 +1013,7 @@ int main(int argc, char* argv[])
1013 } 1013 }
1014 1014
1015 qpdf = qpdf_init(); 1015 qpdf = qpdf_init();
1016 - fn(infile, password, outfile, outfile2); 1016 + fn(infile, password, outfile, xarg);
1017 qpdf_cleanup(&qpdf); 1017 qpdf_cleanup(&qpdf);
1018 assert(qpdf == 0); 1018 assert(qpdf == 0);
1019 1019