add the fuzzer from oss-fuzz and a test that exercises it

This commit is contained in:
Chris Wolfe
2018-04-24 15:05:09 -05:00
parent a133c1d393
commit 700ec688f7
3 changed files with 34 additions and 0 deletions

View File

@@ -37,6 +37,9 @@ LIST (APPEND check_PROGRAMS
version.cpp
visitor.cpp
zone.cpp
# fuzzer tests
fuzz_unpack_pack_fuzzer.cpp
)
IF (MSGPACK_BOOST)

View File

@@ -0,0 +1,10 @@
#include <gtest/gtest.h>
#include "../fuzz/unpack_pack_fuzzer.cc"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
TEST(FUZZ_UNPACK_PACK_FUZZER, works)
{
EXPECT_EQ(0, LLVMFuzzerTestOneInput(0, 0));
}