1717package org .xerial .snappy .fuzz ;
1818
1919import com .code_intelligence .jazzer .api .FuzzedDataProvider ;
20+ import com .code_intelligence .jazzer .junit .FuzzTest ;
2021import org .xerial .snappy .Snappy ;
2122import org .xerial .snappy .BitShuffle ;
2223import java .util .Objects ;
2324
2425public class BitShuffleFuzzer {
2526 private static final int SIZE = 4096 ;
2627
28+ @ FuzzTest
2729 public static void fuzzerTestOneInput (FuzzedDataProvider data ) {
28- switch (data .consumeInt (0 , 4 )) {
30+ switch (data .consumeInt (0 , 8 )) {
2931 case 0 :
3032 fuzzBitshuffle (data .consumeInts (SIZE ), BitShuffle ::shuffle , BitShuffle ::unshuffleIntArray , "int[]" );
3133 break ;
@@ -41,6 +43,18 @@ public static void fuzzerTestOneInput(FuzzedDataProvider data) {
4143 case 4 :
4244 fuzzBitshuffle (data .consumeDoubles (SIZE ), BitShuffle ::shuffle , BitShuffle ::unshuffleDoubleArray , "double[]" );
4345 break ;
46+ case 5 :
47+ fuzzBitshuffle (new int [0 ], BitShuffle ::shuffle , BitShuffle ::unshuffleIntArray , "empty int[]" );
48+ break ;
49+ case 6 :
50+ fuzzBitshuffle (new float [0 ], BitShuffle ::shuffle , BitShuffle ::unshuffleFloatArray , "empty float[]" );
51+ break ;
52+ case 7 :
53+ fuzzBitshuffle (new double [0 ], BitShuffle ::shuffle , BitShuffle ::unshuffleDoubleArray , "empty double[]" );
54+ break ;
55+ case 8 :
56+ fuzzBitshuffle (new short [0 ], BitShuffle ::shuffle , BitShuffle ::unshuffleShortArray , "empty short[]" );
57+ break ;
4458 }
4559 }
4660
0 commit comments