You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2018/03/22 06:20:29 UTC

[25/28] qpid-proton git commit: PROTON-1412: Reorganize standalone regression tester for MacOS and Windows

PROTON-1412: Reorganize standalone regression tester for MacOS and Windows


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/ae7c3a82
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/ae7c3a82
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/ae7c3a82

Branch: refs/heads/master
Commit: ae7c3a823fa71bac3ded7019359e6e8700093795
Parents: 64ed185
Author: Andrew Stitcher <as...@apache.org>
Authored: Wed Mar 21 22:44:49 2018 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Wed Mar 21 23:56:40 2018 -0400

----------------------------------------------------------------------
 proton-c/src/tests/fuzz/CMakeLists.txt          |  2 +-
 .../src/tests/fuzz/StandaloneFuzzTargetInit.c   | 26 ++++++++++++++++++++
 .../src/tests/fuzz/StandaloneFuzzTargetMain.c   |  7 +++---
 3 files changed, 31 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ae7c3a82/proton-c/src/tests/fuzz/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/src/tests/fuzz/CMakeLists.txt b/proton-c/src/tests/fuzz/CMakeLists.txt
index 0e617ee..2805dda 100644
--- a/proton-c/src/tests/fuzz/CMakeLists.txt
+++ b/proton-c/src/tests/fuzz/CMakeLists.txt
@@ -28,7 +28,7 @@ else ()
   set(FUZZING_LIBRARY FuzzingEngine)
 endif ()
 
-add_library (StandaloneFuzzTargetMain StandaloneFuzzTargetMain.c)
+add_library (StandaloneFuzzTargetMain STATIC StandaloneFuzzTargetMain.c StandaloneFuzzTargetInit.c)
 
 macro (pn_add_fuzz_test test)
   add_executable (${test} ${ARGN})

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ae7c3a82/proton-c/src/tests/fuzz/StandaloneFuzzTargetInit.c
----------------------------------------------------------------------
diff --git a/proton-c/src/tests/fuzz/StandaloneFuzzTargetInit.c b/proton-c/src/tests/fuzz/StandaloneFuzzTargetInit.c
new file mode 100644
index 0000000..4c6293c
--- /dev/null
+++ b/proton-c/src/tests/fuzz/StandaloneFuzzTargetInit.c
@@ -0,0 +1,26 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ *
+ */
+
+int LLVMFuzzerInitialize(int *argc, char ***argv)
+{
+  return 0;
+}
+

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ae7c3a82/proton-c/src/tests/fuzz/StandaloneFuzzTargetMain.c
----------------------------------------------------------------------
diff --git a/proton-c/src/tests/fuzz/StandaloneFuzzTargetMain.c b/proton-c/src/tests/fuzz/StandaloneFuzzTargetMain.c
index 0d76ea4..0138745 100644
--- a/proton-c/src/tests/fuzz/StandaloneFuzzTargetMain.c
+++ b/proton-c/src/tests/fuzz/StandaloneFuzzTargetMain.c
@@ -18,12 +18,13 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+extern int LLVMFuzzerInitialize(int *argc, char ***argv);
 extern int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size);
-__attribute__((weak)) extern int LLVMFuzzerInitialize(int *argc, char ***argv);
+
 int main(int argc, char **argv) {
   fprintf(stderr, "StandaloneFuzzTargetMain: running %d inputs\n", argc - 1);
-  if (LLVMFuzzerInitialize)
-    LLVMFuzzerInitialize(&argc, &argv);
+  LLVMFuzzerInitialize(&argc, &argv);
+
   for (int i = 1; i < argc; i++) {
     fprintf(stderr, "Running: %s\n", argv[i]);
     FILE *f = fopen(argv[i], "r");


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org