Class CannedFuzzedDataProvider
- All Implemented Interfaces:
FuzzedDataProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconsumeAsciiString(int maxLength) Consumes an ASCII-onlyStringfrom the fuzzer input.booleanConsumes abooleanfrom the fuzzer input.boolean[]consumeBooleans(int maxLength) Consumes abooleanarray from the fuzzer input.byteConsumes abytefrom the fuzzer input.byteconsumeByte(byte min, byte max) Consumes abytebetweenminandmaxfrom the fuzzer input.byte[]consumeBytes(int maxLength) Consumes abytearray from the fuzzer input.charConsumes acharfrom the fuzzer input.charconsumeChar(char min, char max) Consumes acharbetweenminandmaxfrom the fuzzer input.charConsumes acharfrom the fuzzer input that is never a UTF-16 surrogate character.doubleConsumes adoublefrom the fuzzer input.floatConsumes afloatfrom the fuzzer input.intConsumes anintfrom the fuzzer input.intconsumeInt(int min, int max) Consumes anintbetweenminandmaxfrom the fuzzer input.int[]consumeInts(int maxLength) Consumes anintarray from the fuzzer input.longConsumes alongfrom the fuzzer input.longconsumeLong(long min, long max) Consumes alongbetweenminandmaxfrom the fuzzer input.long[]consumeLongs(int maxLength) Consumes alongarray from the fuzzer input.doubleConsumes adoublebetween 0.0 and 1.0 (inclusive) from the fuzzer input.floatConsumes afloatbetween 0.0 and 1.0 (inclusive) from the fuzzer input.doubleConsumes a regulardoublefrom the fuzzer input.doubleconsumeRegularDouble(double min, double max) Consumes a regulardoublebetweenminandmaxfrom the fuzzer input.floatConsumes a regularfloatfrom the fuzzer input.floatconsumeRegularFloat(float min, float max) Consumes a regularfloatbetweenminandmaxfrom the fuzzer input.Consumes the remaining fuzzer input as an ASCII-onlyString.byte[]Consumes the remaining fuzzer input as abytearray.Consumes the remaining fuzzer input as aString.shortConsumes ashortfrom the fuzzer input.shortconsumeShort(short min, short max) Consumes ashortbetweenminandmaxfrom the fuzzer input.short[]consumeShorts(int maxLength) Consumes ashortarray from the fuzzer input.consumeString(int maxLength) Consumes aStringfrom the fuzzer input.static CannedFuzzedDataProviderintReturns the number of unconsumed bytes in the fuzzer input.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.code_intelligence.jazzer.api.FuzzedDataProvider
pickValue, pickValue, pickValue, pickValue, pickValue, pickValue, pickValue, pickValue, pickValue, pickValue, pickValues, pickValues
-
Constructor Details
-
CannedFuzzedDataProvider
-
-
Method Details
-
create
-
consumeBoolean
public boolean consumeBoolean()Description copied from interface:FuzzedDataProviderConsumes abooleanfrom the fuzzer input.- Specified by:
consumeBooleanin interfaceFuzzedDataProvider- Returns:
- a
boolean
-
consumeBooleans
public boolean[] consumeBooleans(int maxLength) Description copied from interface:FuzzedDataProviderConsumes abooleanarray from the fuzzer input.The array will usually have length
length, but might be shorter if the fuzzer input is not sufficiently long.- Specified by:
consumeBooleansin interfaceFuzzedDataProvider- Parameters:
maxLength- the maximum length of the array- Returns:
- a
booleanarray of length at mostlength
-
consumeByte
public byte consumeByte()Description copied from interface:FuzzedDataProviderConsumes abytefrom the fuzzer input.- Specified by:
consumeBytein interfaceFuzzedDataProvider- Returns:
- a
byte
-
consumeByte
public byte consumeByte(byte min, byte max) Description copied from interface:FuzzedDataProviderConsumes abytebetweenminandmaxfrom the fuzzer input.- Specified by:
consumeBytein interfaceFuzzedDataProvider- Parameters:
min- the inclusive lower bound on the returned valuemax- the inclusive upper bound on the returned value- Returns:
- a
bytein the range[min, max]
-
consumeShort
public short consumeShort()Description copied from interface:FuzzedDataProviderConsumes ashortfrom the fuzzer input.- Specified by:
consumeShortin interfaceFuzzedDataProvider- Returns:
- a
short
-
consumeShort
public short consumeShort(short min, short max) Description copied from interface:FuzzedDataProviderConsumes ashortbetweenminandmaxfrom the fuzzer input.- Specified by:
consumeShortin interfaceFuzzedDataProvider- Parameters:
min- the inclusive lower bound on the returned valuemax- the inclusive upper bound on the returned value- Returns:
- a
shortin the range[min, max]
-
consumeShorts
public short[] consumeShorts(int maxLength) Description copied from interface:FuzzedDataProviderConsumes ashortarray from the fuzzer input.The array will usually have length
length, but might be shorter if the fuzzer input is not sufficiently long.- Specified by:
consumeShortsin interfaceFuzzedDataProvider- Parameters:
maxLength- the maximum length of the array- Returns:
- a
shortarray of length at mostlength
-
consumeInt
public int consumeInt()Description copied from interface:FuzzedDataProviderConsumes anintfrom the fuzzer input.- Specified by:
consumeIntin interfaceFuzzedDataProvider- Returns:
- an
int
-
consumeInt
public int consumeInt(int min, int max) Description copied from interface:FuzzedDataProviderConsumes anintbetweenminandmaxfrom the fuzzer input.- Specified by:
consumeIntin interfaceFuzzedDataProvider- Parameters:
min- the inclusive lower bound on the returned valuemax- the inclusive upper bound on the returned value- Returns:
- an
intin the range[min, max]
-
consumeInts
public int[] consumeInts(int maxLength) Description copied from interface:FuzzedDataProviderConsumes anintarray from the fuzzer input.The array will usually have length
length, but might be shorter if the fuzzer input is not sufficiently long.- Specified by:
consumeIntsin interfaceFuzzedDataProvider- Parameters:
maxLength- the maximum length of the array- Returns:
- an
intarray of length at mostlength
-
consumeLong
public long consumeLong()Description copied from interface:FuzzedDataProviderConsumes alongfrom the fuzzer input.- Specified by:
consumeLongin interfaceFuzzedDataProvider- Returns:
- a
long
-
consumeLong
public long consumeLong(long min, long max) Description copied from interface:FuzzedDataProviderConsumes alongbetweenminandmaxfrom the fuzzer input.- Specified by:
consumeLongin interfaceFuzzedDataProvider- Parameters:
min- the inclusive lower bound on the returned valuemax- the inclusive upper bound on the returned value- Returns:
- a
longin the range @{code [min, max]}
-
consumeLongs
public long[] consumeLongs(int maxLength) Description copied from interface:FuzzedDataProviderConsumes alongarray from the fuzzer input.The array will usually have length
length, but might be shorter if the fuzzer input is not sufficiently long.- Specified by:
consumeLongsin interfaceFuzzedDataProvider- Parameters:
maxLength- the maximum length of the array- Returns:
- a
longarray of length at mostlength
-
consumeFloat
public float consumeFloat()Description copied from interface:FuzzedDataProviderConsumes afloatfrom the fuzzer input.- Specified by:
consumeFloatin interfaceFuzzedDataProvider- Returns:
- a
floatthat may have a special value (e.g. a NaN or infinity)
-
consumeRegularFloat
public float consumeRegularFloat()Description copied from interface:FuzzedDataProviderConsumes a regularfloatfrom the fuzzer input.- Specified by:
consumeRegularFloatin interfaceFuzzedDataProvider- Returns:
- a
floatthat is not a special value (e.g. not a NaN or infinity)
-
consumeRegularFloat
public float consumeRegularFloat(float min, float max) Description copied from interface:FuzzedDataProviderConsumes a regularfloatbetweenminandmaxfrom the fuzzer input.- Specified by:
consumeRegularFloatin interfaceFuzzedDataProvider- Returns:
- a
floatin the range[min, max]
-
consumeProbabilityFloat
public float consumeProbabilityFloat()Description copied from interface:FuzzedDataProviderConsumes afloatbetween 0.0 and 1.0 (inclusive) from the fuzzer input.- Specified by:
consumeProbabilityFloatin interfaceFuzzedDataProvider- Returns:
- a
floatin the range[0.0, 1.0]
-
consumeDouble
public double consumeDouble()Description copied from interface:FuzzedDataProviderConsumes adoublefrom the fuzzer input.- Specified by:
consumeDoublein interfaceFuzzedDataProvider- Returns:
- a
doublethat may have a special value (e.g. a NaN or infinity)
-
consumeRegularDouble
public double consumeRegularDouble(double min, double max) Description copied from interface:FuzzedDataProviderConsumes a regulardoublebetweenminandmaxfrom the fuzzer input.- Specified by:
consumeRegularDoublein interfaceFuzzedDataProvider- Returns:
- a
doublein the range[min, max]
-
consumeRegularDouble
public double consumeRegularDouble()Description copied from interface:FuzzedDataProviderConsumes a regulardoublefrom the fuzzer input.- Specified by:
consumeRegularDoublein interfaceFuzzedDataProvider- Returns:
- a
doublethat is not a special value (e.g. not a NaN or infinity)
-
consumeProbabilityDouble
public double consumeProbabilityDouble()Description copied from interface:FuzzedDataProviderConsumes adoublebetween 0.0 and 1.0 (inclusive) from the fuzzer input.- Specified by:
consumeProbabilityDoublein interfaceFuzzedDataProvider- Returns:
- a
doublein the range[0.0, 1.0]
-
consumeChar
public char consumeChar()Description copied from interface:FuzzedDataProviderConsumes acharfrom the fuzzer input.- Specified by:
consumeCharin interfaceFuzzedDataProvider
-
consumeChar
public char consumeChar(char min, char max) Description copied from interface:FuzzedDataProviderConsumes acharbetweenminandmaxfrom the fuzzer input.- Specified by:
consumeCharin interfaceFuzzedDataProvider- Parameters:
min- the inclusive lower bound on the returned valuemax- the inclusive upper bound on the returned value- Returns:
- a
charin the range[min, max]
-
consumeCharNoSurrogates
public char consumeCharNoSurrogates()Description copied from interface:FuzzedDataProviderConsumes acharfrom the fuzzer input that is never a UTF-16 surrogate character.- Specified by:
consumeCharNoSurrogatesin interfaceFuzzedDataProvider
-
consumeAsciiString
Description copied from interface:FuzzedDataProviderConsumes an ASCII-onlyStringfrom the fuzzer input.The returned string may be of any length between 0 and
maxLength, even if there is more fuzzer input available.- Specified by:
consumeAsciiStringin interfaceFuzzedDataProvider- Parameters:
maxLength- the maximum length of the string- Returns:
- a
Stringof length between 0 andmaxLength(inclusive) that contains only ASCII characters
-
consumeString
Description copied from interface:FuzzedDataProviderConsumes aStringfrom the fuzzer input.The returned string may be of any length between 0 and
maxLength, even if there is more fuzzer input available.- Specified by:
consumeStringin interfaceFuzzedDataProvider- Parameters:
maxLength- the maximum length of the string- Returns:
- a
Stringof length between 0 andmaxLength(inclusive)
-
consumeRemainingAsAsciiString
Description copied from interface:FuzzedDataProviderConsumes the remaining fuzzer input as an ASCII-onlyString.Note: After calling this method, further calls to methods of this interface will return fixed values only.
- Specified by:
consumeRemainingAsAsciiStringin interfaceFuzzedDataProvider- Returns:
- a
Stringthat contains only ASCII characters
-
consumeRemainingAsString
Description copied from interface:FuzzedDataProviderConsumes the remaining fuzzer input as aString.Note: After calling this method, further calls to methods of this interface will return fixed values only.
- Specified by:
consumeRemainingAsStringin interfaceFuzzedDataProvider- Returns:
- a
String
-
consumeBytes
public byte[] consumeBytes(int maxLength) Description copied from interface:FuzzedDataProviderConsumes abytearray from the fuzzer input.The array will usually have length
length, but might be shorter if the fuzzer input is not sufficiently long.- Specified by:
consumeBytesin interfaceFuzzedDataProvider- Parameters:
maxLength- the maximum length of the array- Returns:
- a
bytearray of length at mostlength
-
consumeRemainingAsBytes
public byte[] consumeRemainingAsBytes()Description copied from interface:FuzzedDataProviderConsumes the remaining fuzzer input as abytearray.Note: After calling this method, further calls to methods of this interface will return fixed values only.
- Specified by:
consumeRemainingAsBytesin interfaceFuzzedDataProvider- Returns:
- a
bytearray
-
remainingBytes
public int remainingBytes()Description copied from interface:FuzzedDataProviderReturns the number of unconsumed bytes in the fuzzer input.- Specified by:
remainingBytesin interfaceFuzzedDataProvider- Returns:
- the number of unconsumed bytes in the fuzzer input
-