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