FlatAssetWrapper
All checks were successful
Bigfoot / Build & Test Debug (Unity Build: OFF) (push) Successful in 2m25s
Bigfoot / Build & Test Debug (Unity Build: ON) (push) Successful in 35s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: OFF) (push) Successful in 1m9s
Bigfoot / Build & Test RelWithDebInfo (Unity Build: ON) (push) Successful in 1m3s
Bigfoot / Build & Test Release (Unity Build: OFF) (push) Successful in 1m3s
Bigfoot / Build & Test Release (Unity Build: ON) (push) Successful in 59s
Bigfoot / Clang Format Checks (push) Successful in 11s

This commit is contained in:
2026-02-10 17:52:07 +01:00
parent f5ad5adff6
commit 46c3034ea6
5 changed files with 142 additions and 19 deletions

View File

@@ -6,6 +6,8 @@
*********************************************************************/
#include <Engine/BigFile/BigFile.hpp>
#include <Engine/BigFile/Asset/Asset.hpp>
#include <System/Log/Log.hpp>
#include <System/Time/Time.hpp>
#include <System/UUID/UUID.hpp>
@@ -34,6 +36,8 @@ class BigFileFixture: public ::testing::Test
m_bigFile.CommitTransaction();
}
FlatAssetWrapper<Flat::AssetA> test;
BIGFOOT_NOT_OPTIMIZED_ONLY(Singleton<Log>::Lifetime m_loggerLifetime;)
BigFile m_bigFile {File {BIGFILE_ENGINETESTS_LOCATION}};
@@ -43,6 +47,31 @@ class BigFileFixture: public ::testing::Test
TEST_F(BigFileFixture, Lol)
{
{
UUID uuid;
test.Asset().health = 100;
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();
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->uuid, uuid);
EXPECT_EQ(test2.Asset().asset_header->version, 2);
}
UUID uuid;
UUID uuid2;