Commit eff2c9a67937b875d578b8a744070516f91930e2

Authored by Jay Berkenbilt
1 parent ef23bba4

Cosmetic change to test_driver source

Change variable name for better clarity.
Showing 1 changed file with 14 additions and 14 deletions
qpdf/test_driver.cc
... ... @@ -21,7 +21,7 @@ static char const* whoami = 0;
21 21  
22 22 void usage()
23 23 {
24   - std::cerr << "Usage: " << whoami << " n filename1 [filename2]"
  24 + std::cerr << "Usage: " << whoami << " n filename1 [arg2]"
25 25 << std::endl;
26 26 exit(2);
27 27 }
... ... @@ -82,7 +82,7 @@ static QPDFObjectHandle createPageContents(QPDF&amp; pdf, std::string const&amp; text)
82 82 return QPDFObjectHandle::newStream(&pdf, contents);
83 83 }
84 84  
85   -void runtest(int n, char const* filename1, char const* filename2)
  85 +void runtest(int n, char const* filename1, char const* arg2)
86 86 {
87 87 // Most tests here are crafted to work on specific files. Look at
88 88 // the test suite to see how the test is invoked to find the file
... ... @@ -953,9 +953,9 @@ void runtest(int n, char const* filename1, char const* filename2)
953 953 // Copy qtest without crossing page boundaries. Should get O1
954 954 // and O2 and their streams but not O3 or any other pages.
955 955  
956   - assert(filename2 != 0);
  956 + assert(arg2 != 0);
957 957 QPDF newpdf;
958   - newpdf.processFile(filename2);
  958 + newpdf.processFile(arg2);
959 959 QPDFObjectHandle qtest = pdf.getTrailer().getKey("/QTest");
960 960 newpdf.getTrailer().replaceKey(
961 961 "/QTest", newpdf.copyForeignObject(qtest));
... ... @@ -973,9 +973,9 @@ void runtest(int n, char const* filename1, char const* filename2)
973 973 // that O3 points to. Also, inherited object will have been
974 974 // pushed down and will be preserved.
975 975  
976   - assert(filename2 != 0);
  976 + assert(arg2 != 0);
977 977 QPDF newpdf;
978   - newpdf.processFile(filename2);
  978 + newpdf.processFile(arg2);
979 979 QPDFObjectHandle qtest = pdf.getTrailer().getKey("/QTest");
980 980 QPDFObjectHandle O3 = qtest.getKey("/O3");
981 981 newpdf.addPage(O3, false);
... ... @@ -993,9 +993,9 @@ void runtest(int n, char const* filename1, char const* filename2)
993 993 // Should get qtest plus only the O3 page and the page that O3
994 994 // points to. Inherited objects should be preserved.
995 995  
996   - assert(filename2 != 0);
  996 + assert(arg2 != 0);
997 997 QPDF newpdf;
998   - newpdf.processFile(filename2);
  998 + newpdf.processFile(arg2);
999 999 QPDFObjectHandle qtest = pdf.getTrailer().getKey("/QTest");
1000 1000 QPDFObjectHandle O3 = qtest.getKey("/O3");
1001 1001 newpdf.addPage(O3.getKey("/OtherPage"), false);
... ... @@ -1033,9 +1033,9 @@ void runtest(int n, char const* filename1, char const* filename2)
1033 1033 else if (n == 29)
1034 1034 {
1035 1035 // Detect mixed objects in QPDFWriter
1036   - assert(filename2 != 0);
  1036 + assert(arg2 != 0);
1037 1037 QPDF other;
1038   - other.processFile(filename2);
  1038 + other.processFile(arg2);
1039 1039 // Should use copyForeignObject instead
1040 1040 other.getTrailer().replaceKey(
1041 1041 "/QTest", pdf.getTrailer().getKey("/QTest"));
... ... @@ -1053,9 +1053,9 @@ void runtest(int n, char const* filename1, char const* filename2)
1053 1053 }
1054 1054 else if (n == 30)
1055 1055 {
1056   - assert(filename2 != 0);
  1056 + assert(arg2 != 0);
1057 1057 QPDF encrypted;
1058   - encrypted.processFile(filename2, "user");
  1058 + encrypted.processFile(arg2, "user");
1059 1059 QPDFWriter w(pdf, "b.pdf");
1060 1060 w.setStreamDataMode(qpdf_s_preserve);
1061 1061 w.copyEncryptionParameters(encrypted);
... ... @@ -1189,8 +1189,8 @@ int main(int argc, char* argv[])
1189 1189 {
1190 1190 int n = atoi(argv[1]);
1191 1191 char const* filename1 = argv[2];
1192   - char const* filename2 = argv[3];
1193   - runtest(n, filename1, filename2);
  1192 + char const* arg2 = argv[3];
  1193 + runtest(n, filename1, arg2);
1194 1194 }
1195 1195 catch (std::exception& e)
1196 1196 {
... ...