File tree Expand file tree Collapse file tree 10 files changed +22
-54
lines changed
app/src/test/java/com/example
testsuite/src/fuzzTest/java/com/example
gradle-junit-4-and-5/src/test/java/com/example
gradle-kotlin/src/test/kotlin/com/example
gradle/src/test/java/com/example
maven-junit-4-and-5/src/test/java/com/example
maven/src/test/java/com/example Expand file tree Collapse file tree 10 files changed +22
-54
lines changed Original file line number Diff line number Diff line change 11package com .example ;
22
3- import com .code_intelligence .jazzer .api .FuzzedDataProvider ;
43import com .code_intelligence .jazzer .junit .FuzzTest ;
4+ import com .code_intelligence .jazzer .mutation .annotation .NotNull ;
5+
56import org .junit .jupiter .api .Test ;
67
78public class TestCases {
@@ -20,11 +21,8 @@ public void remoteCodeTest() {
2021 }
2122
2223 @ FuzzTest
23- void remoteCodeFuzzTest (FuzzedDataProvider data ) {
24+ void remoteCodeFuzzTest (int a , @ NotNull String b ) {
2425 // Fuzz test that finds RCE
25- int a = data .consumeInt ();
26- String b = data .consumeRemainingAsString ();
27-
2826 RemoteCodeExecution remoteCode = new RemoteCodeExecution (a );
2927 remoteCode .trigger (b );
3028 }
Original file line number Diff line number Diff line change 11package com .example ;
22
3- import com .code_intelligence .jazzer .api .FuzzedDataProvider ;
43import com .code_intelligence .jazzer .junit .FuzzTest ;
54import org .junit .jupiter .api .Test ;
65
76public class OutOfBoundsTestCase {
87 @ FuzzTest
9- void fuzzTest (FuzzedDataProvider data ) {
8+ void fuzzTest (int a ) {
109 // Triggers array out of bounds exception
11- int a = data .consumeInt ();
12-
1310 OutOfBounds outOfBounds = new OutOfBounds ();
1411 outOfBounds .trigger (a );
1512 }
Original file line number Diff line number Diff line change 11package com .example ;
22
3- import com .code_intelligence .jazzer .api .FuzzedDataProvider ;
43import com .code_intelligence .jazzer .junit .FuzzTest ;
5- import com .example . RemoteCodeExecution ;
4+ import com .code_intelligence . jazzer . mutation . annotation . NotNull ;
65
76public class RCEFuzzTestCase {
87 @ FuzzTest
9- void fuzzTestTrigger (FuzzedDataProvider data ) {
10- // Trigger remote code execution
11- int a = data .consumeInt ();
12- String b = data .consumeRemainingAsString ();
13-
8+ void fuzzTestTrigger (int a , @ NotNull String b ) {
149 RemoteCodeExecution rce = new RemoteCodeExecution (a );
1510 rce .trigger (b );
1611 }
1712
1813 @ FuzzTest
19- void fuzzTestDontTrigger (FuzzedDataProvider data ) {
14+ void fuzzTestDontTrigger (@ NotNull String b ) {
2015 // Don't trigger remote code execution
2116 // by using the overloaded constructor
22- String b = data .consumeRemainingAsString ();
23-
2417 RemoteCodeExecution rce = new RemoteCodeExecution ();
2518 rce .trigger (b );
2619 }
Original file line number Diff line number Diff line change 1- import com .code_intelligence .jazzer .api .FuzzedDataProvider ;
21import com .code_intelligence .jazzer .junit .FuzzTest ;
32import util .NegativeArraySize ;
43
54public class NegativeArraySizeFuzzTest {
65
76 @ FuzzTest
8- void fuzzTest (FuzzedDataProvider data ) {
7+ void fuzzTest (int a ) {
98 // Trigger Negative Array Size Exception
10- NegativeArraySize .negative (data . consumeInt () );
9+ NegativeArraySize .negative (a );
1110 }
1211}
Original file line number Diff line number Diff line change 11package util ;
22
3- import com .code_intelligence .jazzer .api .FuzzedDataProvider ;
43import com .code_intelligence .jazzer .junit .FuzzTest ;
4+ import com .code_intelligence .jazzer .mutation .annotation .NotNull ;
55import org .junit .jupiter .api .Test ;
66
77import static org .junit .jupiter .api .Assertions .assertEquals ;
@@ -15,8 +15,8 @@ public void joinTest() throws Exception {
1515 }
1616
1717 @ FuzzTest
18- void joinFuzzTest (FuzzedDataProvider data ) throws Exception {
18+ void joinFuzzTest (@ NotNull String a ) throws Exception {
1919 // Trigger Exception
20- Util .join (data . consumeRemainingAsString () );
20+ Util .join (a );
2121 }
2222}
Original file line number Diff line number Diff line change 11package com .example ;
22
3- import com .code_intelligence .jazzer .api .FuzzedDataProvider ;
43import com .code_intelligence .jazzer .junit .FuzzTest ;
4+ import com .code_intelligence .jazzer .mutation .annotation .NotNull ;
55
66class ExploreFuzzTest {
77 @ FuzzTest
8- void myFuzzTest (FuzzedDataProvider data ) {
9- int a = data .consumeInt ();
10- int b = data .consumeInt ();
11- String c = data .consumeRemainingAsString ();
12-
8+ void myFuzzTest (int a , int b , @ NotNull String c ) {
139 ExploreMe ex = new ExploreMe (a );
1410 ex .exploreMe (b , c );
1511 }
Original file line number Diff line number Diff line change 11package com.example
22
3- import com.code_intelligence.jazzer.api.FuzzedDataProvider
43import com.code_intelligence.jazzer.junit.FuzzTest
4+ import com.code_intelligence.jazzer.mutation.annotation.NotNull
55
66class FuzzTestCase {
77 @FuzzTest
8- fun myFuzzTest (data : FuzzedDataProvider ) {
9- val a: Int = data.consumeInt()
10- val b: Int = data.consumeInt()
11- val c: String = data.consumeRemainingAsString()
8+ fun myFuzzTest (a : Int , b : Int , @NotNull c : String ) {
129 val ex = ExploreMe (a)
1310 ex.exploreMe(b, c)
1411 }
Original file line number Diff line number Diff line change 11package com .example ;
22
3- import com .code_intelligence .jazzer .api .FuzzedDataProvider ;
43import com .code_intelligence .jazzer .junit .FuzzTest ;
4+ import com .code_intelligence .jazzer .mutation .annotation .NotNull ;
55
66public class FuzzTestCase {
77 @ FuzzTest
8- void myFuzzTest (FuzzedDataProvider data ) {
9- int a = data .consumeInt ();
10- int b = data .consumeInt ();
11- String c = data .consumeRemainingAsString ();
12-
8+ void myFuzzTest (int a , int b , @ NotNull String c ) {
139 ExploreMe ex = new ExploreMe (a );
1410 ex .exploreMe (b , c );
1511 }
Original file line number Diff line number Diff line change 11package com .example ;
22
3- import com .code_intelligence .jazzer .api .FuzzedDataProvider ;
43import com .code_intelligence .jazzer .junit .FuzzTest ;
4+ import com .code_intelligence .jazzer .mutation .annotation .NotNull ;
55
66class ExploreFuzzTest {
77 @ FuzzTest
8- void myFuzzTest (FuzzedDataProvider data ) {
9- int a = data .consumeInt ();
10- int b = data .consumeInt ();
11- String c = data .consumeRemainingAsString ();
12-
8+ void myFuzzTest (int a , int b , @ NotNull String c ) {
139 ExploreMe ex = new ExploreMe (a );
1410 ex .exploreMe (b , c );
1511 }
Original file line number Diff line number Diff line change 11package com .example ;
22
3- import com .code_intelligence .jazzer .api .FuzzedDataProvider ;
43import com .code_intelligence .jazzer .junit .FuzzTest ;
4+ import com .code_intelligence .jazzer .mutation .annotation .NotNull ;
55
66public class FuzzTestCase {
77 @ FuzzTest
8- void myFuzzTest (FuzzedDataProvider data ) {
9- int a = data .consumeInt ();
10- int b = data .consumeInt ();
11- String c = data .consumeRemainingAsString ();
12-
8+ void myFuzzTest (int a , int b , @ NotNull String c ) {
139 ExploreMe ex = new ExploreMe (a );
1410 ex .exploreMe (b , c );
1511 }
You can’t perform that action at this time.
0 commit comments