aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf/test_driver.cc
diff options
context:
space:
mode:
Diffstat (limited to 'qpdf/test_driver.cc')
-rw-r--r--qpdf/test_driver.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/qpdf/test_driver.cc b/qpdf/test_driver.cc
index 28d8062c..565b517d 100644
--- a/qpdf/test_driver.cc
+++ b/qpdf/test_driver.cc
@@ -1942,7 +1942,9 @@ test_51(QPDF& pdf, char const* arg2)
} else if (Tval == "checkbox1") {
std::cout << "turning checkbox1 on\n";
QPDFFormFieldObjectHelper foh(field);
- foh.setV(QPDFObjectHandle::newName("/Yes"));
+ // The value that eventually gets set is based on what's allowed in /N and may not match
+ // this value.
+ foh.setV(QPDFObjectHandle::newName("/Sure"));
} else if (Tval == "checkbox2") {
std::cout << "turning checkbox2 off\n";
QPDFFormFieldObjectHelper foh(field);
@@ -3380,6 +3382,22 @@ test_97(QPDF& pdf, char const* arg2)
assert(nulls.unparse() == nulls2.unparse());
}
+static void
+test_98(QPDF& pdf, char const* arg2)
+{
+ // Test QPDFObjectHandle::writeJSON. This test is built for minimal.pdf.
+ for (int i = 1; i < 7; ++i) {
+ auto oh = pdf.getObject(i, 0);
+ Pl_Buffer bf1{"write", nullptr};
+ Pl_Buffer bf2{"get", nullptr};
+ oh.writeJSON(JSON::LATEST, &bf1, true, 7);
+ bf1.finish();
+ oh.getJSON(JSON::LATEST, true).write(&bf2, 7);
+ bf2.finish();
+ assert(bf1.getString() == bf2.getString());
+ }
+}
+
void
runtest(int n, char const* filename1, char const* arg2)
{
@@ -3481,7 +3499,7 @@ runtest(int n, char const* filename1, char const* arg2)
{78, test_78}, {79, test_79}, {80, test_80}, {81, test_81}, {82, test_82}, {83, test_83},
{84, test_84}, {85, test_85}, {86, test_86}, {87, test_87}, {88, test_88}, {89, test_89},
{90, test_90}, {91, test_91}, {92, test_92}, {93, test_93}, {94, test_94}, {95, test_95},
- {96, test_96}, {97, test_97}};
+ {96, test_96}, {97, test_97}, {98, test_98}};
auto fn = test_functions.find(n);
if (fn == test_functions.end()) {