Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Aug 8, 2014
1 parent a8c6438 commit b806933
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.fasterxml.jackson.core.main;

import java.io.CharArrayReader;

import com.fasterxml.jackson.core.*;
import com.fasterxml.jackson.core.io.NumberInput;

/**
Expand Down Expand Up @@ -79,5 +82,22 @@ public void testLongBoundsChecks() throws Exception
assertFalse(NumberInput.inLongRange(cbuf, 0, cbuf.length, true));
assertFalse(NumberInput.inLongRange(cbuf, 0, cbuf.length, false));
}


public void testFloatBoundary146() throws Exception
{
final char[] arr = new char[20000];
final JsonFactory f = new JsonFactory();
for(int i = 500; i != 9000; ++i) {
java.util.Arrays.fill(arr, 0, i, ' ');
arr[i] = '-';
arr[i + 1] = '1';
arr[i + 2] = 'e';
arr[i + 3] = '-';
arr[i + 4] = '1';
CharArrayReader r = new CharArrayReader(arr, 0, i+5);
JsonParser p = f.createParser(r);
assertToken(JsonToken.VALUE_NUMBER_FLOAT, p.nextToken());
p.close();
}
}
}

0 comments on commit b806933

Please sign in to comment.