mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-10 15:16:28 +00:00
bulk code format fix (#8707)
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include "test_init.h"
|
||||
|
||||
static std::filesystem::path exe_path_;
|
||||
static const uint8_t *schema_bfbs_;
|
||||
static const uint8_t* schema_bfbs_;
|
||||
static size_t schema_bfbs_length_;
|
||||
|
||||
bool TestFileExists(std::filesystem::path file_path) {
|
||||
@@ -14,7 +14,7 @@ bool TestFileExists(std::filesystem::path file_path) {
|
||||
return true;
|
||||
|
||||
TEST_OUTPUT_LINE("@DEBUG: file '%s' not found", file_path.string().c_str());
|
||||
for (const auto &entry :
|
||||
for (const auto& entry :
|
||||
std::filesystem::directory_iterator(file_path.parent_path())) {
|
||||
TEST_OUTPUT_LINE("@DEBUG: parent path entry: '%s'",
|
||||
entry.path().string().c_str());
|
||||
@@ -22,7 +22,7 @@ bool TestFileExists(std::filesystem::path file_path) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string LoadBinarySchema(const char *file_name) {
|
||||
std::string LoadBinarySchema(const char* file_name) {
|
||||
const auto file_path = exe_path_.parent_path() / file_name;
|
||||
TEST_EQ(true, TestFileExists(file_path));
|
||||
std::string schemafile;
|
||||
@@ -30,21 +30,21 @@ std::string LoadBinarySchema(const char *file_name) {
|
||||
flatbuffers::LoadFile(file_path.string().c_str(), true, &schemafile));
|
||||
|
||||
flatbuffers::Verifier verifier(
|
||||
reinterpret_cast<const uint8_t *>(schemafile.c_str()), schemafile.size());
|
||||
reinterpret_cast<const uint8_t*>(schemafile.c_str()), schemafile.size());
|
||||
TEST_EQ(true, reflection::VerifySchemaBuffer(verifier));
|
||||
return schemafile;
|
||||
}
|
||||
|
||||
extern "C" int LLVMFuzzerInitialize(int *, char ***argv) {
|
||||
extern "C" int LLVMFuzzerInitialize(int*, char*** argv) {
|
||||
exe_path_ = (*argv)[0];
|
||||
static const std::string schema_file =
|
||||
LoadBinarySchema("annotated_binary.bfbs");
|
||||
schema_bfbs_ = reinterpret_cast<const uint8_t *>(schema_file.c_str());
|
||||
schema_bfbs_ = reinterpret_cast<const uint8_t*>(schema_file.c_str());
|
||||
schema_bfbs_length_ = schema_file.size();
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
flatbuffers::BinaryAnnotator annotator(schema_bfbs_, schema_bfbs_length_,
|
||||
data, size, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user