Skip to content

Commit 3e7a0b1

Browse files
author
John J. Aylward
committed
new test case for issue 484
1 parent 6dcd82a commit 3e7a0b1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/test/java/org/json/junit/JSONMLTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,4 +803,16 @@ public void testToJSONObject_reversibility() {
803803
//
804804
// assertEquals(expectedJsonString, actualJsonString);
805805
// }
806+
807+
@Test (timeout = 6000)
808+
public void testIssue484InfinteLoop() {
809+
try {
810+
JSONML.toJSONObject("??*^M??|?CglR^F??`??>?w??PIlr^E??D^X^]?$?-^R?o??O?*??{OD?^FY??`2a????NM?b^Tq?:O?>S$^K?J?^FB.gUK?m^H??zE??^??!v]?^A???^[^A??^U?c??????h???s???g^Z???`?q^Dbi??:^QZl?)?}1^??k?0??:$V?$?Ovs(}J??^V????2;^QgQ?^_^A?^D?^U?Tg?K?`?h%c?hmGA?<!C*^P^Y?^X9?~?t?)??,z^XA???S}?Q??.q?j????]");
811+
fail("Exception expected for invalid JSON.");
812+
} catch (JSONException ex) {
813+
assertEquals("Exception string did not match: ",
814+
"Unterminated string at 271 [character 272 line 1]",
815+
ex.getMessage());
816+
}
817+
}
806818
}

0 commit comments

Comments
 (0)