Simplify Java example names (#159)
diff --git a/.github/workflows/bazel_test.yml b/.github/workflows/bazel_test.yml
index 281169e..6b308af 100644
--- a/.github/workflows/bazel_test.yml
+++ b/.github/workflows/bazel_test.yml
@@ -88,7 +88,7 @@
strategy:
matrix:
config: ["jazzer", "asan-jazzer"]
- target: ["//examples/java:JavaEmptyFuzzTest_run"]
+ target: ["//examples/java:EmptyFuzzTest_run"]
steps:
- name: Checkout repository
uses: actions/checkout@v2
diff --git a/examples/java/BUILD b/examples/java/BUILD
index 46f6840..4dc1352 100644
--- a/examples/java/BUILD
+++ b/examples/java/BUILD
@@ -28,24 +28,24 @@
)
java_fuzz_test(
- name = "JavaEmptyFuzzTest",
- srcs = ["com/example/JavaEmptyFuzzTest.java"],
+ name = "EmptyFuzzTest",
+ srcs = ["com/example/EmptyFuzzTest.java"],
corpus = [
"corpus_0.txt",
],
)
java_fuzz_test(
- name = "JavaFuzzTest",
- srcs = ["com/example/JavaFuzzTest.java"],
+ name = "FuzzTest",
+ srcs = ["com/example/FuzzTest.java"],
tags = [
"no-oss-fuzz",
],
)
java_fuzz_test(
- name = "JavaNativeFuzzTest",
- srcs = ["com/example/JavaNativeFuzzTest.java"],
+ name = "NativeFuzzTest",
+ srcs = ["com/example/NativeFuzzTest.java"],
corpus = [
":corpus",
],
@@ -58,8 +58,8 @@
)
java_fuzz_test(
- name = "JavaNativeRunfileFuzzTest",
- srcs = ["com/example/JavaNativeRunfileFuzzTest.java"],
+ name = "NativeRunfileFuzzTest",
+ srcs = ["com/example/NativeRunfileFuzzTest.java"],
data = [
"corpus_0.txt",
],
@@ -73,8 +73,8 @@
cc_binary(
name = "native",
srcs = [
- "com/example/JavaNativeFuzzTest.cpp",
- "com/example/JavaNativeFuzzTest.h",
+ "com/example/NativeFuzzTest.cpp",
+ "com/example/NativeFuzzTest.h",
],
linkshared = True,
deps = [
@@ -85,8 +85,8 @@
cc_binary(
name = "native_runfile",
srcs = [
- "com/example/JavaNativeRunfileFuzzTest.cpp",
- "com/example/JavaNativeRunfileFuzzTest.h",
+ "com/example/NativeRunfileFuzzTest.cpp",
+ "com/example/NativeRunfileFuzzTest.h",
],
data = [
"corpus_1.txt",
diff --git a/examples/java/com/example/JavaEmptyFuzzTest.java b/examples/java/com/example/EmptyFuzzTest.java
similarity index 95%
rename from examples/java/com/example/JavaEmptyFuzzTest.java
rename to examples/java/com/example/EmptyFuzzTest.java
index 7c7002b..b03a5d6 100644
--- a/examples/java/com/example/JavaEmptyFuzzTest.java
+++ b/examples/java/com/example/EmptyFuzzTest.java
@@ -14,7 +14,7 @@
package com.example;
-public class JavaEmptyFuzzTest {
+public class EmptyFuzzTest {
public static void fuzzerTestOneInput(byte[] input) {
}
}
diff --git a/examples/java/com/example/JavaFuzzTest.java b/examples/java/com/example/FuzzTest.java
similarity index 97%
rename from examples/java/com/example/JavaFuzzTest.java
rename to examples/java/com/example/FuzzTest.java
index 457eeb6..97691d4 100644
--- a/examples/java/com/example/JavaFuzzTest.java
+++ b/examples/java/com/example/FuzzTest.java
@@ -17,7 +17,7 @@
import com.code_intelligence.jazzer.api.FuzzedDataProvider;
import com.code_intelligence.jazzer.api.FuzzerSecurityIssueMedium;
-public class JavaFuzzTest {
+public class FuzzTest {
public static void fuzzerInitialize() {
// Optional initialization to be run before the first call to fuzzerTestOneInput.
}
diff --git a/examples/java/com/example/JavaNativeFuzzTest.cpp b/examples/java/com/example/NativeFuzzTest.cpp
similarity index 91%
rename from examples/java/com/example/JavaNativeFuzzTest.cpp
rename to examples/java/com/example/NativeFuzzTest.cpp
index 849139a..6402c86 100644
--- a/examples/java/com/example/JavaNativeFuzzTest.cpp
+++ b/examples/java/com/example/NativeFuzzTest.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "JavaNativeFuzzTest.h"
+#include "NativeFuzzTest.h"
#include <string>
@@ -27,7 +27,7 @@
}
}
-JNIEXPORT jboolean JNICALL Java_com_example_JavaNativeFuzzTest_parse(
+JNIEXPORT jboolean JNICALL Java_com_example_NativeFuzzTest_parse(
JNIEnv *env, jobject o, jstring bytes) {
const char *input(env->GetStringUTFChars(bytes, nullptr));
parseInternal(input);
diff --git a/examples/java/com/example/JavaNativeFuzzTest.h b/examples/java/com/example/NativeFuzzTest.h
similarity index 69%
rename from examples/java/com/example/JavaNativeFuzzTest.h
rename to examples/java/com/example/NativeFuzzTest.h
index e9b154e..a408299 100644
--- a/examples/java/com/example/JavaNativeFuzzTest.h
+++ b/examples/java/com/example/NativeFuzzTest.h
@@ -13,22 +13,22 @@
// limitations under the License.
#include <jni.h>
-/* Header for class com_example_JavaNativeFuzzTest */
+/* Header for class com_example_NativeFuzzTest */
-#ifndef EXAMPLES_JAVA_COM_EXAMPLE_JAVANATIVEFUZZTEST_H_
-#define EXAMPLES_JAVA_COM_EXAMPLE_JAVANATIVEFUZZTEST_H_
+#ifndef EXAMPLES_JAVA_COM_EXAMPLE_NATIVEFUZZTEST_H_
+#define EXAMPLES_JAVA_COM_EXAMPLE_NATIVEFUZZTEST_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
- * Class: com_example_JavaNativeFuzzTest
+ * Class: com_example_NativeFuzzTest
* Method: parse
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL
-Java_com_example_JavaNativeFuzzTest_parse(JNIEnv *, jobject, jstring);
+Java_com_example_NativeFuzzTest_parse(JNIEnv *, jobject, jstring);
#ifdef __cplusplus
}
#endif
-#endif // EXAMPLES_JAVA_COM_EXAMPLE_JAVANATIVEFUZZTEST_H_
+#endif // EXAMPLES_JAVA_COM_EXAMPLE_NATIVEFUZZTEST_H_
diff --git a/examples/java/com/example/JavaNativeFuzzTest.java b/examples/java/com/example/NativeFuzzTest.java
similarity index 91%
rename from examples/java/com/example/JavaNativeFuzzTest.java
rename to examples/java/com/example/NativeFuzzTest.java
index 7a4ab6c..801f44c 100644
--- a/examples/java/com/example/JavaNativeFuzzTest.java
+++ b/examples/java/com/example/NativeFuzzTest.java
@@ -16,7 +16,7 @@
import com.code_intelligence.jazzer.api.FuzzedDataProvider;
-public class JavaNativeFuzzTest {
+public class NativeFuzzTest {
static {
System.loadLibrary("native");
}
@@ -26,7 +26,7 @@
String stringData = data.consumeRemainingAsString();
if (val == 17759716 && stringData.length() > 10 && stringData.contains("jazzer")) {
// call native function which contains a crash
- new com.example.JavaNativeFuzzTest().parse(stringData);
+ new com.example.NativeFuzzTest().parse(stringData);
}
}
diff --git a/examples/java/com/example/JavaNativeRunfileFuzzTest.cpp b/examples/java/com/example/NativeRunfileFuzzTest.cpp
similarity index 91%
rename from examples/java/com/example/JavaNativeRunfileFuzzTest.cpp
rename to examples/java/com/example/NativeRunfileFuzzTest.cpp
index 49fa739..1ddc044 100644
--- a/examples/java/com/example/JavaNativeRunfileFuzzTest.cpp
+++ b/examples/java/com/example/NativeRunfileFuzzTest.cpp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "JavaNativeRunfileFuzzTest.h"
+#include "NativeRunfileFuzzTest.h"
#include <fstream>
#include <iostream>
@@ -21,7 +21,7 @@
#include "tools/cpp/runfiles/runfiles.h"
JNIEXPORT void JNICALL
-Java_com_example_JavaNativeRunfileFuzzTest_loadCppRunfile(JNIEnv *env,
+Java_com_example_NativeRunfileFuzzTest_loadCppRunfile(JNIEnv *env,
jobject o) {
using ::bazel::tools::cpp::runfiles::Runfiles;
std::string error;
diff --git a/examples/java/com/example/JavaNativeRunfileFuzzTest.h b/examples/java/com/example/NativeRunfileFuzzTest.h
similarity index 66%
rename from examples/java/com/example/JavaNativeRunfileFuzzTest.h
rename to examples/java/com/example/NativeRunfileFuzzTest.h
index fae7355..fd742e3 100644
--- a/examples/java/com/example/JavaNativeRunfileFuzzTest.h
+++ b/examples/java/com/example/NativeRunfileFuzzTest.h
@@ -13,22 +13,22 @@
// limitations under the License.
#include <jni.h>
-/* Header for class com_example_JavaNativeRunfileFuzzTest */
+/* Header for class com_example_NativeRunfileFuzzTest */
-#ifndef EXAMPLES_JAVA_COM_EXAMPLE_JAVANATIVERUNFILEFUZZTEST_H_
-#define EXAMPLES_JAVA_COM_EXAMPLE_JAVANATIVERUNFILEFUZZTEST_H_
+#ifndef EXAMPLES_JAVA_COM_EXAMPLE_NATIVERUNFILEFUZZTEST_H_
+#define EXAMPLES_JAVA_COM_EXAMPLE_NATIVERUNFILEFUZZTEST_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
- * Class: com_example_JavaNativeRunfileFuzzTest
+ * Class: com_example_NativeRunfileFuzzTest
* Method: loadCppRunfile
* Signature: ()V
*/
JNIEXPORT void JNICALL
-Java_com_example_JavaNativeRunfileFuzzTest_loadCppRunfile(JNIEnv *, jobject);
+Java_com_example_NativeRunfileFuzzTest_loadCppRunfile(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
-#endif // EXAMPLES_JAVA_COM_EXAMPLE_JAVANATIVERUNFILEFUZZTEST_H_
+#endif // EXAMPLES_JAVA_COM_EXAMPLE_NATIVERUNFILEFUZZTEST_H_
diff --git a/examples/java/com/example/JavaNativeRunfileFuzzTest.java b/examples/java/com/example/NativeRunfileFuzzTest.java
similarity index 97%
rename from examples/java/com/example/JavaNativeRunfileFuzzTest.java
rename to examples/java/com/example/NativeRunfileFuzzTest.java
index c1457c3..cada0c3 100644
--- a/examples/java/com/example/JavaNativeRunfileFuzzTest.java
+++ b/examples/java/com/example/NativeRunfileFuzzTest.java
@@ -20,7 +20,7 @@
import java.io.IOException;
import java.io.File;
-public class JavaNativeRunfileFuzzTest {
+public class NativeRunfileFuzzTest {
static {
System.loadLibrary("native_runfile");