Correct TypeID and TypeName
All checks were successful
Bigfoot / Build & Test Debug (Unity Build: OFF) (push) Successful in 2m31s
Bigfoot / Build & Test Debug (Unity Build: ON) (push) Successful in 36s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: OFF) (push) Successful in 1m8s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: ON) (push) Successful in 1m4s
Bigfoot / Build & Test Release (Unity Build: OFF) (push) Successful in 59s
Bigfoot / Build & Test Release (Unity Build: ON) (push) Successful in 54s
Bigfoot / Clang Format Checks (push) Successful in 10s

This commit is contained in:
2026-02-11 01:10:45 +01:00
parent 46c3034ea6
commit e4bcf5563c
2 changed files with 36 additions and 5 deletions

View File

@@ -54,20 +54,23 @@ TEST_F(BigFileFixture, Lol)
test.Asset().mana = 42;
test.Asset().asset_header->name = "Instance";
test.Asset().asset_header->type_id = 1;
test.Asset().asset_header->type_name = "AssetA";
test.Asset().asset_header->uuid = uuid;
test.Asset().asset_header->version = 2;
const eastl::vector<std::byte> flatbuffer = test.Pack();
EXPECT_STREQ(FlatAssetWrapper<Flat::AssetA>::TypeName().data(), "Bigfoot.Flat.AssetA");
EXPECT_EQ(FlatAssetWrapper<Flat::AssetA>::TypeID(),
rapidhash(FlatAssetWrapper<Flat::AssetA>::TypeName().data(),
FlatAssetWrapper<Flat::AssetA>::TypeName().size()));
FlatAssetWrapper<Flat::AssetA> test2 {flatbuffer};
EXPECT_EQ(test2.Asset().health, 100);
EXPECT_EQ(test2.Asset().mana, 42);
EXPECT_STREQ(test2.Asset().asset_header->name.c_str(), "Instance");
EXPECT_EQ(test2.Asset().asset_header->type_id, 1);
EXPECT_STREQ(test2.Asset().asset_header->type_name.c_str(), "AssetA");
EXPECT_EQ(test2.Asset().asset_header->type_id, FlatAssetWrapper<Flat::AssetA>::TypeID());
EXPECT_STREQ(test2.Asset().asset_header->type_name.c_str(), FlatAssetWrapper<Flat::AssetA>::TypeName().data());
EXPECT_EQ(test2.Asset().asset_header->uuid, uuid);
EXPECT_EQ(test2.Asset().asset_header->version, 2);
}