llvm-capstone/libcxx/fuzzing/fuzz_test_template.cpp
Eric Fiselier daacf57032 [libc++] Add fuzzing tests for parts of <random>.
This patch also re-names the existing fuzzing unit tests so they
actually run.
2019-12-11 15:47:06 -05:00

23 lines
681 B
C++

//===------------------------- fuzz_test.cpp ------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "fuzzing/fuzzing.h"
#ifdef NDEBUG
#undef NDEBUG
#endif
#include <cassert>
#ifndef TEST_FUNCTION
#error TEST_FUNCTION must be defined
#endif
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
int result = fuzzing::TEST_FUNCTION(data, size);
assert(result == 0); return 0;
}