Skip to content

Commit

Permalink
new test case for issue 484
Browse files Browse the repository at this point in the history
  • Loading branch information
John J. Aylward committed Sep 17, 2019
1 parent 6dcd82a commit 3e7a0b1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/java/org/json/junit/JSONMLTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -803,4 +803,16 @@ public void testToJSONObject_reversibility() {
//
// assertEquals(expectedJsonString, actualJsonString);
// }

@Test (timeout = 6000)
public void testIssue484InfinteLoop() {
try {
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????]");
fail("Exception expected for invalid JSON.");
} catch (JSONException ex) {
assertEquals("Exception string did not match: ",
"Unterminated string at 271 [character 272 line 1]",
ex.getMessage());
}
}
}

0 comments on commit 3e7a0b1

Please sign in to comment.