Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
148e93c
commit ccd0fc4
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
cbor/src/test/java/com/fasterxml/jackson/dataformat/cbor/failing/TagParsing185Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.fasterxml.jackson.dataformat.cbor.failing; | ||
|
||
import com.fasterxml.jackson.core.*; | ||
|
||
import com.fasterxml.jackson.dataformat.cbor.*; | ||
|
||
public class TagParsing185Test extends CBORTestBase | ||
{ | ||
private final CBORFactory CBOR_F = new CBORFactory(); | ||
|
||
public void testRecursiveTags() throws Exception | ||
{ | ||
_testRecursiveTags(20000); | ||
} | ||
|
||
private void _testRecursiveTags(int levels) throws Exception | ||
{ | ||
byte[] data = new byte[levels * 2]; | ||
for (int i = 0; i < levels; i++) { | ||
data[i * 2] = (byte)(CBORConstants.PREFIX_TYPE_TAG + | ||
CBORConstants.TAG_DECIMAL_FRACTION); | ||
data[(i * 2) + 1] = (byte)(CBORConstants.PREFIX_TYPE_ARRAY + | ||
2); | ||
} | ||
|
||
JsonParser p = CBOR_F.createParser(data); | ||
|
||
assertToken(JsonToken.START_ARRAY, p.nextToken()); | ||
} | ||
} |