MCPcopy Create free account
hub / github.com/alibaba/MNN / LoadVerifyBinaryTest

Function LoadVerifyBinaryTest

3rd_party/flatbuffers/tests/test.cpp:2381–2390  ·  view source on GitHub ↗

For testing any binaries, e.g. from fuzzing.

Source from the content-addressed store, hash-verified

2379
2380// For testing any binaries, e.g. from fuzzing.
2381void LoadVerifyBinaryTest() {
2382 std::string binary;
2383 if (flatbuffers::LoadFile((test_data_path +
2384 "fuzzer/your-filename-here").c_str(),
2385 true, &binary)) {
2386 flatbuffers::Verifier verifier(
2387 reinterpret_cast<const uint8_t *>(binary.data()), binary.size());
2388 TEST_EQ(VerifyMonsterBuffer(verifier), true);
2389 }
2390}
2391
2392void CreateSharedStringTest() {
2393 flatbuffers::FlatBufferBuilder builder;

Callers 1

FlatBufferTestsFunction · 0.85

Calls 5

LoadFileFunction · 0.85
VerifyMonsterBufferFunction · 0.70
c_strMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected