mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 07:50:52 -07:00
add second case for data in #484
This commit is contained in:
parent
3e7a0b13d1
commit
67e59888a2
1 changed files with 17 additions and 1 deletions
|
@ -2,6 +2,8 @@ package org.json.junit;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
import java.util.Base64;
|
||||||
|
|
||||||
import org.json.*;
|
import org.json.*;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -805,7 +807,7 @@ public class JSONMLTest {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@Test (timeout = 6000)
|
@Test (timeout = 6000)
|
||||||
public void testIssue484InfinteLoop() {
|
public void testIssue484InfinteLoop1() {
|
||||||
try {
|
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????]");
|
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.");
|
fail("Exception expected for invalid JSON.");
|
||||||
|
@ -815,4 +817,18 @@ public class JSONMLTest {
|
||||||
ex.getMessage());
|
ex.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test (timeout = 6000)
|
||||||
|
public void testIssue484InfinteLoop2() {
|
||||||
|
try {
|
||||||
|
String input = "??*\n" +
|
||||||
|
"??|?CglR??`??>?w??PIlr??D?$?-?o??O?*??{OD?Y??`2a????NM?bq?:O?>S$?J?B.gUK?m\b??zE???!v]???????c??????h???s???g???`?qbi??:Zl?)?}1^??k?0??:$V?$?Ovs(}J??????2;gQ????Tg?K?`?h%c?hmGA?<!C*?9?~?t?)??,zA???S}?Q??.q?j????]";
|
||||||
|
JSONML.toJSONObject(input);
|
||||||
|
fail("Exception expected for invalid JSON.");
|
||||||
|
} catch (JSONException ex) {
|
||||||
|
assertEquals("Exception string did not match: ",
|
||||||
|
"Unterminated string at 242 [character 238 line 2]",
|
||||||
|
ex.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue