aboutsummaryrefslogtreecommitdiffstats
path: root/libtests
diff options
context:
space:
mode:
authorJay Berkenbilt <jberkenbilt@users.noreply.github.com>2023-02-18 23:43:02 +0100
committerGitHub <noreply@github.com>2023-02-18 23:43:02 +0100
commite4e03e9ac10d8ea0c1a8ef8c78f0103068928822 (patch)
treeaf59791cbe95f318581878ebc7d4b95fd8b20be3 /libtests
parent76189c44a2f656e6623a7d36519e406d488a9ee5 (diff)
parentb6f048546f7ffdd228bd9360c647b3064dfa1bf3 (diff)
downloadqpdf-e4e03e9ac10d8ea0c1a8ef8c78f0103068928822.tar.zst
Merge pull request #890 from m-holger/jpsp
Eliminate the use of shared pointers in JSONParser
Diffstat (limited to 'libtests')
-rw-r--r--libtests/libtests.testcov8
-rw-r--r--libtests/qtest/json_parse.test8
-rw-r--r--libtests/qtest/json_parse/bad-01.out2
-rw-r--r--libtests/qtest/json_parse/bad-02.out2
-rw-r--r--libtests/qtest/json_parse/bad-03.out2
-rw-r--r--libtests/qtest/json_parse/bad-04.out2
-rw-r--r--libtests/qtest/json_parse/bad-09.out2
-rw-r--r--libtests/qtest/json_parse/bad-18.out2
-rw-r--r--libtests/qtest/json_parse/bad-27.out2
-rw-r--r--libtests/qtest/json_parse/bad-28.out2
-rw-r--r--libtests/qtest/json_parse/bad-30.out2
-rw-r--r--libtests/qtest/json_parse/bad-31.json2
-rw-r--r--libtests/qtest/json_parse/bad-31.out2
-rw-r--r--libtests/qtest/json_parse/bad-32.out2
-rw-r--r--libtests/qtest/json_parse/bad-33.out2
-rw-r--r--libtests/qtest/json_parse/bad-34.out2
-rw-r--r--libtests/qtest/json_parse/bad-41.json2
-rw-r--r--libtests/qtest/json_parse/bad-41.out1
-rw-r--r--libtests/qtest/json_parse/bad-42.json1
-rw-r--r--libtests/qtest/json_parse/bad-42.out1
-rw-r--r--libtests/qtest/json_parse/bad-43.json1
-rw-r--r--libtests/qtest/json_parse/bad-43.out1
-rw-r--r--libtests/qtest/json_parse/bad-44.json1
-rw-r--r--libtests/qtest/json_parse/bad-44.out1
-rw-r--r--libtests/qtest/json_parse/bad-45.json1
-rw-r--r--libtests/qtest/json_parse/bad-45.out1
-rw-r--r--libtests/qtest/json_parse/bad-46.json1
-rw-r--r--libtests/qtest/json_parse/bad-46.out1
-rw-r--r--libtests/qtest/json_parse/bad-47.json2
-rw-r--r--libtests/qtest/json_parse/bad-47.out1
-rw-r--r--libtests/qtest/json_parse/bad-48.json1
-rw-r--r--libtests/qtest/json_parse/bad-48.out1
-rw-r--r--libtests/qtest/json_parse/good-01-react.out4
-rw-r--r--libtests/qtest/json_parse/good-04-react.out10
-rw-r--r--libtests/qtest/json_parse/good-10-react.out10
-rw-r--r--libtests/qtest/json_parse/good-11-react.out4
36 files changed, 58 insertions, 32 deletions
diff --git a/libtests/libtests.testcov b/libtests/libtests.testcov
index 2ceef541..5e5c2e00 100644
--- a/libtests/libtests.testcov
+++ b/libtests/libtests.testcov
@@ -58,7 +58,6 @@ QPDFArgParser bad option for help 0
QPDFArgParser bad topic for help 0
QPDFArgParser invalid choice handler to unknown 0
JSON parse junk after object 0
-JSON parse decimal with no digits 0
JSON parse invalid keyword 0
JSON parse expected colon 0
JSON parse expected , or } 0
@@ -76,12 +75,13 @@ JSON parse duplicate point 0
JSON parse duplicate e 0
JSON parse unexpected sign 0
JSON parse numeric bad character 0
+JSON parse number minus no digits 0
+JSON parse incomplete number 0
JSON parse keyword bad character 0
JSON parse backslash bad character 0
-JSON parse unterminated string 0
+JSON parse control char in string 0
JSON parse leading zero 0
-JSON parse number no digits 0
-JSON parse premature end of u 0
+JSON parse ls premature end of input 0
JSON parse bad hex after u 0
JSONHandler unhandled value 0
JSONHandler unexpected key 0
diff --git a/libtests/qtest/json_parse.test b/libtests/qtest/json_parse.test
index 112da0a9..699544f6 100644
--- a/libtests/qtest/json_parse.test
+++ b/libtests/qtest/json_parse.test
@@ -121,6 +121,14 @@ my @bad = (
"high high surrogate", # 38
"dangling high surrogate", # 39
"duplicate dictionary key", # 40
+ "decimal point after minus",# 41
+ "e after minus", # 42
+ "missing digit after e", # 43
+ "missing digit after e+/-", # 44
+ "tab char in string", # 45
+ "cr char in string", # 46
+ "lf char in string", # 47
+ "bs char in string", # 48
);
my $i = 0;
diff --git a/libtests/qtest/json_parse/bad-01.out b/libtests/qtest/json_parse/bad-01.out
index a4254cff..8ae96c30 100644
--- a/libtests/qtest/json_parse/bad-01.out
+++ b/libtests/qtest/json_parse/bad-01.out
@@ -1 +1 @@
-exception: bad-01.json: JSON: offset 9: material follows end of object: junk
+exception: bad-01.json: JSON: offset 8: material follows end of object: junk
diff --git a/libtests/qtest/json_parse/bad-02.out b/libtests/qtest/json_parse/bad-02.out
index 485c9658..212b2f4f 100644
--- a/libtests/qtest/json_parse/bad-02.out
+++ b/libtests/qtest/json_parse/bad-02.out
@@ -1 +1 @@
-exception: bad-02.json: JSON: offset 11: material follows end of object: junk
+exception: bad-02.json: JSON: offset 10: material follows end of object: junk
diff --git a/libtests/qtest/json_parse/bad-03.out b/libtests/qtest/json_parse/bad-03.out
index 38f35119..a1411e0e 100644
--- a/libtests/qtest/json_parse/bad-03.out
+++ b/libtests/qtest/json_parse/bad-03.out
@@ -1 +1 @@
-exception: bad-03.json: JSON: offset 16: material follows end of object: junk
+exception: bad-03.json: JSON: offset 15: material follows end of object: junk
diff --git a/libtests/qtest/json_parse/bad-04.out b/libtests/qtest/json_parse/bad-04.out
index 7fe71693..27d252f2 100644
--- a/libtests/qtest/json_parse/bad-04.out
+++ b/libtests/qtest/json_parse/bad-04.out
@@ -1 +1 @@
-exception: bad-04.json: JSON: offset 5: decimal point with no digits
+exception: bad-04.json: JSON: offset 4: unexpected character .
diff --git a/libtests/qtest/json_parse/bad-09.out b/libtests/qtest/json_parse/bad-09.out
index 21d2f1c1..979d53d0 100644
--- a/libtests/qtest/json_parse/bad-09.out
+++ b/libtests/qtest/json_parse/bad-09.out
@@ -1 +1 @@
-exception: bad-09.json: JSON: offset 3: expect string as dictionary key
+exception: bad-09.json: JSON: offset 2: expect string as dictionary key
diff --git a/libtests/qtest/json_parse/bad-18.out b/libtests/qtest/json_parse/bad-18.out
index 0428b64f..1e779e41 100644
--- a/libtests/qtest/json_parse/bad-18.out
+++ b/libtests/qtest/json_parse/bad-18.out
@@ -1 +1 @@
-exception: bad-18.json: JSON: null character at offset 5
+exception: bad-18.json: JSON: control or null character at offset 5
diff --git a/libtests/qtest/json_parse/bad-27.out b/libtests/qtest/json_parse/bad-27.out
index 2c2df076..4c1ecfeb 100644
--- a/libtests/qtest/json_parse/bad-27.out
+++ b/libtests/qtest/json_parse/bad-27.out
@@ -1 +1 @@
-exception: bad-27.json: JSON: offset 6: unterminated string
+exception: bad-27.json: JSON: offset 5: control character in string (missing "?)
diff --git a/libtests/qtest/json_parse/bad-28.out b/libtests/qtest/json_parse/bad-28.out
index d7db2aea..005a68d2 100644
--- a/libtests/qtest/json_parse/bad-28.out
+++ b/libtests/qtest/json_parse/bad-28.out
@@ -1 +1 @@
-exception: bad-28.json: JSON: offset 16: unterminated string
+exception: bad-28.json: JSON: premature end of input
diff --git a/libtests/qtest/json_parse/bad-30.out b/libtests/qtest/json_parse/bad-30.out
index bff961af..ec63bb09 100644
--- a/libtests/qtest/json_parse/bad-30.out
+++ b/libtests/qtest/json_parse/bad-30.out
@@ -1 +1 @@
-exception: bad-30.json: JSON: offset 5: decimal point with no digits
+exception: bad-30.json: JSON: offset 4: numeric literal: incomplete number
diff --git a/libtests/qtest/json_parse/bad-31.json b/libtests/qtest/json_parse/bad-31.json
index 39cdd0de..277cc02f 100644
--- a/libtests/qtest/json_parse/bad-31.json
+++ b/libtests/qtest/json_parse/bad-31.json
@@ -1 +1 @@
--
+-
diff --git a/libtests/qtest/json_parse/bad-31.out b/libtests/qtest/json_parse/bad-31.out
index 344f42e8..af177726 100644
--- a/libtests/qtest/json_parse/bad-31.out
+++ b/libtests/qtest/json_parse/bad-31.out
@@ -1 +1 @@
-exception: bad-31.json: JSON: offset 2: number with no digits
+exception: bad-31.json: JSON: offset 1: numeric literal: incomplete number
diff --git a/libtests/qtest/json_parse/bad-32.out b/libtests/qtest/json_parse/bad-32.out
index 4372e0cf..41a681c0 100644
--- a/libtests/qtest/json_parse/bad-32.out
+++ b/libtests/qtest/json_parse/bad-32.out
@@ -1 +1 @@
-exception: bad-32.json: JSON: offset 5: number with leading zero
+exception: bad-32.json: JSON: offset 1: number with leading zero
diff --git a/libtests/qtest/json_parse/bad-33.out b/libtests/qtest/json_parse/bad-33.out
index ae41e48b..98a72942 100644
--- a/libtests/qtest/json_parse/bad-33.out
+++ b/libtests/qtest/json_parse/bad-33.out
@@ -1 +1 @@
-exception: bad-33.json: JSON: offset 6: number with leading zero
+exception: bad-33.json: JSON: offset 2: number with leading zero
diff --git a/libtests/qtest/json_parse/bad-34.out b/libtests/qtest/json_parse/bad-34.out
index f9db587a..c21838c4 100644
--- a/libtests/qtest/json_parse/bad-34.out
+++ b/libtests/qtest/json_parse/bad-34.out
@@ -1 +1 @@
-exception: bad-34.json: JSON: offset 3: \u must be followed by four characters
+exception: bad-34.json: JSON: premature end of input
diff --git a/libtests/qtest/json_parse/bad-41.json b/libtests/qtest/json_parse/bad-41.json
new file mode 100644
index 00000000..dad59049
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-41.json
@@ -0,0 +1,2 @@
+-.123
+
diff --git a/libtests/qtest/json_parse/bad-41.out b/libtests/qtest/json_parse/bad-41.out
new file mode 100644
index 00000000..bebcfdb9
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-41.out
@@ -0,0 +1 @@
+exception: bad-41.json: JSON: offset 1: numeric literal: no digit after minus sign
diff --git a/libtests/qtest/json_parse/bad-42.json b/libtests/qtest/json_parse/bad-42.json
new file mode 100644
index 00000000..2f9148b0
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-42.json
@@ -0,0 +1 @@
+-e123
diff --git a/libtests/qtest/json_parse/bad-42.out b/libtests/qtest/json_parse/bad-42.out
new file mode 100644
index 00000000..96e9a0a3
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-42.out
@@ -0,0 +1 @@
+exception: bad-42.json: JSON: offset 1: numeric literal: no digit after minus sign
diff --git a/libtests/qtest/json_parse/bad-43.json b/libtests/qtest/json_parse/bad-43.json
new file mode 100644
index 00000000..896a676a
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-43.json
@@ -0,0 +1 @@
+123e
diff --git a/libtests/qtest/json_parse/bad-43.out b/libtests/qtest/json_parse/bad-43.out
new file mode 100644
index 00000000..84070aa9
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-43.out
@@ -0,0 +1 @@
+exception: bad-43.json: JSON: offset 4: numeric literal: incomplete number
diff --git a/libtests/qtest/json_parse/bad-44.json b/libtests/qtest/json_parse/bad-44.json
new file mode 100644
index 00000000..3a5d7dff
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-44.json
@@ -0,0 +1 @@
+123e+
diff --git a/libtests/qtest/json_parse/bad-44.out b/libtests/qtest/json_parse/bad-44.out
new file mode 100644
index 00000000..f72120c4
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-44.out
@@ -0,0 +1 @@
+exception: bad-44.json: JSON: offset 5: numeric literal: incomplete number
diff --git a/libtests/qtest/json_parse/bad-45.json b/libtests/qtest/json_parse/bad-45.json
new file mode 100644
index 00000000..16107dc0
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-45.json
@@ -0,0 +1 @@
+"Tab in str ing"
diff --git a/libtests/qtest/json_parse/bad-45.out b/libtests/qtest/json_parse/bad-45.out
new file mode 100644
index 00000000..d4320b0a
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-45.out
@@ -0,0 +1 @@
+exception: bad-45.json: JSON: offset 11: control character in string (missing "?)
diff --git a/libtests/qtest/json_parse/bad-46.json b/libtests/qtest/json_parse/bad-46.json
new file mode 100644
index 00000000..60873bf4
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-46.json
@@ -0,0 +1 @@
+"cr in str ing"
diff --git a/libtests/qtest/json_parse/bad-46.out b/libtests/qtest/json_parse/bad-46.out
new file mode 100644
index 00000000..50aa5ffb
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-46.out
@@ -0,0 +1 @@
+exception: bad-46.json: JSON: offset 10: control character in string (missing "?)
diff --git a/libtests/qtest/json_parse/bad-47.json b/libtests/qtest/json_parse/bad-47.json
new file mode 100644
index 00000000..3c75427a
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-47.json
@@ -0,0 +1,2 @@
+"lf in str
+ing"
diff --git a/libtests/qtest/json_parse/bad-47.out b/libtests/qtest/json_parse/bad-47.out
new file mode 100644
index 00000000..39f9d3d5
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-47.out
@@ -0,0 +1 @@
+exception: bad-47.json: JSON: offset 10: control character in string (missing "?)
diff --git a/libtests/qtest/json_parse/bad-48.json b/libtests/qtest/json_parse/bad-48.json
new file mode 100644
index 00000000..1e605808
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-48.json
@@ -0,0 +1 @@
+"bs in string" \ No newline at end of file
diff --git a/libtests/qtest/json_parse/bad-48.out b/libtests/qtest/json_parse/bad-48.out
new file mode 100644
index 00000000..0b20fc7a
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-48.out
@@ -0,0 +1 @@
+exception: bad-48.json: JSON: control or null character at offset 10
diff --git a/libtests/qtest/json_parse/good-01-react.out b/libtests/qtest/json_parse/good-01-react.out
index e3813bcc..3951272d 100644
--- a/libtests/qtest/json_parse/good-01-react.out
+++ b/libtests/qtest/json_parse/good-01-react.out
@@ -1,13 +1,13 @@
dictionary start
dictionary item: a -> [6, 11): "bcd"
-dictionary item: e -> [18, 0): []
+dictionary item: e -> [18, 19): []
array start
array item: [19, 20): 1
array item: [41, 42): 2
array item: [44, 45): 3
array item: [46, 47): 4
array item: [48, 54): "five"
-array item: [56, 0): {}
+array item: [56, 57): {}
dictionary start
dictionary item: six -> [64, 65): 7
dictionary item: 8 -> [72, 73): 9
diff --git a/libtests/qtest/json_parse/good-04-react.out b/libtests/qtest/json_parse/good-04-react.out
index ded004b2..8d931535 100644
--- a/libtests/qtest/json_parse/good-04-react.out
+++ b/libtests/qtest/json_parse/good-04-react.out
@@ -1,15 +1,15 @@
array start
-array item: [1, 0): []
+array item: [1, 2): []
array start
-array item: [2, 0): []
+array item: [2, 3): []
array start
-array item: [3, 0): {}
+array item: [3, 4): {}
dictionary start
container end: [3, 5): {}
container end: [2, 6): []
-array item: [8, 0): {}
+array item: [8, 9): {}
dictionary start
-dictionary item: -> [13, 0): {}
+dictionary item: -> [13, 14): {}
dictionary start
container end: [13, 15): {}
container end: [8, 16): {}
diff --git a/libtests/qtest/json_parse/good-10-react.out b/libtests/qtest/json_parse/good-10-react.out
index 3cceeb2f..8c31f915 100644
--- a/libtests/qtest/json_parse/good-10-react.out
+++ b/libtests/qtest/json_parse/good-10-react.out
@@ -1,21 +1,21 @@
dictionary start
-dictionary item: a -> [9, 0): []
+dictionary item: a -> [9, 10): []
array start
array item: [10, 11): 1
array item: [13, 14): 2
-array item: [16, 0): {}
+array item: [16, 17): {}
dictionary start
dictionary item: x -> [22, 25): "y"
container end: [16, 26): {}
array item: [28, 29): 3
-array item: [31, 0): {}
+array item: [31, 32): {}
dictionary start
dictionary item: keep -> [40, 61): "not in final output"
container end: [31, 62): {
"keep": "not in final output"
}
container end: [9, 63): []
-dictionary item: keep -> [75, 0): []
+dictionary item: keep -> [75, 76): []
array start
array item: [76, 77): 1
array item: [79, 83): null
@@ -23,7 +23,7 @@ array item: [85, 86): 2
array item: [88, 93): false
array item: [95, 101): "keep"
array item: [103, 104): 3
-array item: [106, 0): []
+array item: [106, 107): []
array start
array item: [107, 113): "this"
array item: [115, 121): "keep"
diff --git a/libtests/qtest/json_parse/good-11-react.out b/libtests/qtest/json_parse/good-11-react.out
index 6cf3345e..6d7d4275 100644
--- a/libtests/qtest/json_parse/good-11-react.out
+++ b/libtests/qtest/json_parse/good-11-react.out
@@ -1,12 +1,12 @@
array start
-array item: [4, 0): []
+array item: [4, 5): []
array start
array item: [5, 11): "u:π"
array item: [13, 23): "u:π"
array item: [25, 39): "b:EFBBBFCF80"
array item: [41, 53): "b:feff03c0"
container end: [4, 54): []
-array item: [58, 0): []
+array item: [58, 59): []
array start
array item: [59, 67): "u:🥔"
array item: [69, 85): "u:🥔"