mirror of
https://github.com/google/flatbuffers.git
synced 2026-11-08 13:19:10 +00:00
Bigfoot
This commit is contained in:
+5
-27
@@ -34,7 +34,6 @@
|
||||
#include "third_party/absl/container/flat_hash_set.h"
|
||||
#endif
|
||||
#include "alignment_test.h"
|
||||
#include "cross_namespace_pack_test_generated.h"
|
||||
#include "default_vectors_strings_test.h"
|
||||
#include "evolution_test.h"
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
@@ -67,6 +66,8 @@
|
||||
#include "native_type_test_generated.h"
|
||||
#include "test_assert.h"
|
||||
#include "util_test.h"
|
||||
#include "cpp_vector_type_test.h"
|
||||
#include "bigfoot_ref_test_impl.h"
|
||||
#include "vector_table_naked_ptr_test.h"
|
||||
|
||||
void FlatBufferBuilderTest();
|
||||
@@ -951,7 +952,6 @@ void NativeTypeTest() {
|
||||
TEST_EQ(dstDataT->position_inline.x, 4.0f);
|
||||
TEST_EQ(dstDataT->position_inline.y, 5.0f);
|
||||
TEST_EQ(dstDataT->position_inline.z, 6.0f);
|
||||
|
||||
for (int i = 0; i < N; ++i) {
|
||||
const Native::Vector3D& v = dstDataT->vectors[i];
|
||||
TEST_EQ(v.x, 10 * i + 0.1f);
|
||||
@@ -1722,29 +1722,6 @@ static void Offset64Tests() {
|
||||
#endif
|
||||
}
|
||||
|
||||
// Test that Pack() generates correctly namespace-qualified Create* calls
|
||||
// when referencing tables from different namespaces. (issue #8948)
|
||||
void CrossNamespacePackTest() {
|
||||
// Build a Consumer with a cross-namespace TableWithNative reference.
|
||||
foo::ConsumerT consumer;
|
||||
consumer.c1 = std::make_unique<native::TableWithNativeT>();
|
||||
consumer.c1->value = 42;
|
||||
|
||||
// Add a vector element too.
|
||||
consumer.c2.push_back(std::make_unique<native::TableWithNativeT>());
|
||||
consumer.c2[0]->value = 99;
|
||||
|
||||
// Pack and verify round-trip.
|
||||
flatbuffers::FlatBufferBuilder fbb;
|
||||
fbb.Finish(foo::Consumer::Pack(fbb, &consumer));
|
||||
|
||||
auto* packed = flatbuffers::GetRoot<foo::Consumer>(fbb.GetBufferPointer());
|
||||
auto unpacked = packed->UnPack();
|
||||
TEST_EQ(unpacked->c1->value, 42);
|
||||
TEST_EQ(unpacked->c2.size(), 1);
|
||||
TEST_EQ(unpacked->c2[0]->value, 99);
|
||||
}
|
||||
|
||||
int FlatBufferTests(const std::string& tests_data_path) {
|
||||
// Run our various test suites:
|
||||
|
||||
@@ -1768,13 +1745,14 @@ int FlatBufferTests(const std::string& tests_data_path) {
|
||||
|
||||
AlignmentTest();
|
||||
|
||||
CppVectorTypeTest();
|
||||
|
||||
#ifndef FLATBUFFERS_NO_FILE_TESTS
|
||||
ParseAndGenerateTextTest(tests_data_path, false);
|
||||
ParseAndGenerateTextTest(tests_data_path, true);
|
||||
FixedLengthArrayJsonTest(tests_data_path, false);
|
||||
FixedLengthArrayJsonTest(tests_data_path, true);
|
||||
ReflectionTest(tests_data_path, flatbuf.data(), flatbuf.size());
|
||||
ForAllFieldsReverseTest(tests_data_path);
|
||||
ParseProtoTest(tests_data_path);
|
||||
EvolutionTest(tests_data_path);
|
||||
UnionDeprecationTest(tests_data_path);
|
||||
@@ -1838,6 +1816,7 @@ int FlatBufferTests(const std::string& tests_data_path) {
|
||||
InvalidFloatTest();
|
||||
FixedLengthArrayTest();
|
||||
NativeTypeTest();
|
||||
flatbuffers::tests::BigfootRefTest();
|
||||
OptionalScalarsTest();
|
||||
ParseFlexbuffersFromJsonWithNullTest();
|
||||
FlatbuffersSpanTest();
|
||||
@@ -1863,7 +1842,6 @@ int FlatBufferTests(const std::string& tests_data_path) {
|
||||
UnionUnderlyingTypeTest();
|
||||
StructsInHashTableTest();
|
||||
DefaultVectorsStringsTest();
|
||||
CrossNamespacePackTest();
|
||||
return 0;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user