-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create base test cases for Java integration
Signed-off-by: Arthur Chan <[email protected]>
- Loading branch information
1 parent
bd8a8f8
commit e4254c5
Showing
12 changed files
with
257 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
The simple one class java fuzzer |
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,22 @@ | ||
// Copyright 2022 Fuzz Introspector Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
/////////////////////////////////////////////////////////////////////////// | ||
|
||
import com.code_intelligence.jazzer.api.FuzzedDataProvider; | ||
|
||
public class TestFuzzer { | ||
public static void fuzzerTestOneInput(FuzzedDataProvider data) { | ||
return; | ||
} | ||
} |
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 @@ | ||
Test case with reachable and unreachable methods in same class |
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,44 @@ | ||
// Copyright 2022 Fuzz Introspector Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
/////////////////////////////////////////////////////////////////////////// | ||
|
||
import com.code_intelligence.jazzer.api.FuzzedDataProvider; | ||
|
||
public class TestFuzzer { | ||
private void function1() { | ||
return; | ||
} | ||
|
||
private static void function2() { | ||
return; | ||
} | ||
|
||
void functionPublicDead() { | ||
return; | ||
} | ||
|
||
private void functionPrivateDead() { | ||
return; | ||
} | ||
|
||
public static void fuzzerTestOneInput(FuzzedDataProvider data) { | ||
int choice = data.consumeInt(0,1); | ||
if (choice == 0) { | ||
TestFuzzer tf = new TestFuzzer(); | ||
tf.function1(); | ||
} else { | ||
TestFuzzer.function2(); | ||
} | ||
} | ||
} |
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 @@ | ||
Test case with reachable and unreachable methods in different class |
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,49 @@ | ||
// Copyright 2022 Fuzz Introspector Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
/////////////////////////////////////////////////////////////////////////// | ||
|
||
import com.code_intelligence.jazzer.api.FuzzedDataProvider; | ||
|
||
class FunctionTest { | ||
protected void function1() { | ||
return; | ||
} | ||
|
||
protected static void function2() { | ||
return; | ||
} | ||
|
||
protected void functionPublicDead() { | ||
return; | ||
} | ||
|
||
private void functionPrivateDead() { | ||
return; | ||
} | ||
|
||
} | ||
|
||
public class TestFuzzer { | ||
|
||
public static void fuzzerTestOneInput(FuzzedDataProvider data) { | ||
int choice = data.consumeInt(0,1); | ||
|
||
if (choice == 0) { | ||
FunctionTest ft = new FunctionTest(); | ||
ft.function1(); | ||
} else { | ||
FunctionTest.function2(); | ||
} | ||
} | ||
} |
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,37 @@ | ||
// Copyright 2022 Fuzz Introspector Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
/////////////////////////////////////////////////////////////////////////// | ||
|
||
package Fuzz; | ||
|
||
import com.code_intelligence.jazzer.api.FuzzedDataProvider; | ||
|
||
public class FunctionTest { | ||
protected void function1() { | ||
return; | ||
} | ||
|
||
protected static void function2() { | ||
return; | ||
} | ||
|
||
protected void functionPublicDead() { | ||
return; | ||
} | ||
|
||
private void functionPrivateDead() { | ||
return; | ||
} | ||
|
||
} |
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 @@ | ||
Test case with reachable and unreachable methods in different class in same package but different java file |
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,31 @@ | ||
// Copyright 2022 Fuzz Introspector Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
/////////////////////////////////////////////////////////////////////////// | ||
|
||
package Fuzz; | ||
|
||
import com.code_intelligence.jazzer.api.FuzzedDataProvider; | ||
|
||
public class TestFuzzer { | ||
public static void fuzzerTestOneInput(FuzzedDataProvider data) { | ||
int choice = data.consumeInt(0,1); | ||
|
||
if (choice == 0) { | ||
FunctionTest ft = new FunctionTest(); | ||
ft.function1(); | ||
} else { | ||
FunctionTest.function2(); | ||
} | ||
} | ||
} |
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,37 @@ | ||
// Copyright 2022 Fuzz Introspector Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
/////////////////////////////////////////////////////////////////////////// | ||
|
||
package Function; | ||
|
||
import com.code_intelligence.jazzer.api.FuzzedDataProvider; | ||
|
||
public class FunctionTest { | ||
public void function1() { | ||
return; | ||
} | ||
|
||
public static void function2() { | ||
return; | ||
} | ||
|
||
public void functionPublicDead() { | ||
return; | ||
} | ||
|
||
private void functionPrivateDead() { | ||
return; | ||
} | ||
|
||
} |
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 @@ | ||
Test case with reachable and unreachable methods in different class in different |
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,32 @@ | ||
// Copyright 2022 Fuzz Introspector Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
/////////////////////////////////////////////////////////////////////////// | ||
|
||
package Fuzz; | ||
|
||
import Function.FunctionTest; | ||
import com.code_intelligence.jazzer.api.FuzzedDataProvider; | ||
|
||
public class TestFuzzer { | ||
public static void fuzzerTestOneInput(FuzzedDataProvider data) { | ||
int choice = data.consumeInt(0,1); | ||
|
||
if (choice == 0) { | ||
FunctionTest ft = new FunctionTest(); | ||
ft.function1(); | ||
} else { | ||
FunctionTest.function2(); | ||
} | ||
} | ||
} |