Prevent assets from keeping each other alive
Bigfoot / Clang Format Checks (push) Failing after 11s
Bigfoot / Sonarqube (push) Skipped
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: game) (push) Successful in 38s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: ON, Variant: game) (push) Successful in 26s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 41s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Successful in 26s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 1m3s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: game) (push) Successful in 48s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m11s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 56s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: game) (push) Successful in 44s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: ON, Variant: game) (push) Successful in 27s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 47s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Successful in 33s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 1m8s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: game) (push) Successful in 53s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m14s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 59s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: game) (push) Successful in 31s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: ON, Variant: game) (push) Successful in 26s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 52s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Successful in 43s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 48s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: game) (push) Successful in 40s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 52s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 47s
Bigfoot / Clang Format Checks (push) Failing after 11s
Bigfoot / Sonarqube (push) Skipped
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: game) (push) Successful in 38s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: ON, Variant: game) (push) Successful in 26s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 41s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Successful in 26s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 1m3s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: game) (push) Successful in 48s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m11s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 56s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: game) (push) Successful in 44s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: ON, Variant: game) (push) Successful in 27s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 47s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Successful in 33s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 1m8s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: game) (push) Successful in 53s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m14s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 59s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: game) (push) Successful in 31s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: ON, Variant: game) (push) Successful in 26s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 52s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Successful in 43s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 48s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: game) (push) Successful in 40s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 52s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 47s
This commit is contained in:
@@ -45,50 +45,60 @@ class SerializationManagerFixture: public ::testing::Test
|
||||
std::ignore = m_library.Insert(&m_containerC);
|
||||
|
||||
// leaf
|
||||
m_leaf.SetName("leaf");
|
||||
m_leafUUID = m_leaf.GetHeader().uuid;
|
||||
AssetA leaf;
|
||||
leaf.SetName("leaf");
|
||||
m_leafUUID = leaf.GetHeader().uuid;
|
||||
|
||||
// middle --> leaf
|
||||
m_middle.SetName("middle");
|
||||
m_middle.GetAsset().ref_a = HardReference<AssetA> {m_leafUUID};
|
||||
m_middleUUID = m_middle.GetHeader().uuid;
|
||||
AssetB middle;
|
||||
middle.SetName("middle");
|
||||
middle.GetAsset().ref_a = HardReference<AssetA> {m_leafUUID};
|
||||
m_middleUUID = middle.GetHeader().uuid;
|
||||
|
||||
// root
|
||||
// / \
|
||||
// v v
|
||||
// middle --> leaf
|
||||
//
|
||||
// root HardReferences both middle and leaf directly, so leaf ends up shared by two different paths
|
||||
m_root.GetAsset().asset_b_ref = HardReference<AssetB> {m_middleUUID};
|
||||
m_root.GetAsset().inner_table->asset_a_ref = HardReference<AssetA> {m_leafUUID};
|
||||
m_rootUUID = m_root.GetHeader().uuid;
|
||||
AssetC root;
|
||||
root.GetAsset().asset_b_ref = HardReference<AssetB> {m_middleUUID};
|
||||
root.GetAsset().inner_table->asset_a_ref = HardReference<AssetA> {m_leafUUID};
|
||||
m_rootUUID = root.GetHeader().uuid;
|
||||
|
||||
// cycleX <--> cycleY
|
||||
//
|
||||
// ref_a is typed as a HardReference<AssetA>, but a HardReference only carries a UUID: reusing it to point
|
||||
// at another AssetB is enough to form a cycle for this test
|
||||
m_cycleX.GetAsset().ref_a = HardReference<AssetA> {m_cycleY.GetHeader().uuid};
|
||||
m_cycleY.GetAsset().ref_a = HardReference<AssetA> {m_cycleX.GetHeader().uuid};
|
||||
m_cycleXUUID = m_cycleX.GetHeader().uuid;
|
||||
m_cycleYUUID = m_cycleY.GetHeader().uuid;
|
||||
AssetB cycleX;
|
||||
AssetB cycleY;
|
||||
cycleX.GetAsset().ref_a = HardReference<AssetA> {cycleY.GetHeader().uuid};
|
||||
cycleY.GetAsset().ref_a = HardReference<AssetA> {cycleX.GetHeader().uuid};
|
||||
m_cycleXUUID = cycleX.GetHeader().uuid;
|
||||
m_cycleYUUID = cycleY.GetHeader().uuid;
|
||||
|
||||
// sharedChild
|
||||
m_sharedChild.SetName("shared");
|
||||
m_sharedChildUUID = m_sharedChild.GetHeader().uuid;
|
||||
AssetA sharedChild;
|
||||
sharedChild.SetName("shared");
|
||||
m_sharedChildUUID = sharedChild.GetHeader().uuid;
|
||||
|
||||
// multiRootA multiRootB
|
||||
// \ /
|
||||
// v v
|
||||
// sharedChild
|
||||
m_multiRootA.SetName("rootA");
|
||||
m_multiRootA.GetAsset().ref_a = HardReference<AssetA> {m_sharedChildUUID};
|
||||
m_multiRootAUUID = m_multiRootA.GetHeader().uuid;
|
||||
AssetB multiRootA;
|
||||
multiRootA.SetName("rootA");
|
||||
multiRootA.GetAsset().ref_a = HardReference<AssetA> {m_sharedChildUUID};
|
||||
m_multiRootAUUID = multiRootA.GetHeader().uuid;
|
||||
|
||||
m_multiRootB.SetName("rootB");
|
||||
m_multiRootB.GetAsset().ref_a = HardReference<AssetA> {m_sharedChildUUID};
|
||||
m_multiRootBUUID = m_multiRootB.GetHeader().uuid;
|
||||
AssetB multiRootB;
|
||||
multiRootB.SetName("rootB");
|
||||
multiRootB.GetAsset().ref_a = HardReference<AssetA> {m_sharedChildUUID};
|
||||
m_multiRootBUUID = multiRootB.GetHeader().uuid;
|
||||
|
||||
Populate({&m_leaf, &m_middle, &m_root, &m_cycleX, &m_cycleY, &m_sharedChild, &m_multiRootA, &m_multiRootB});
|
||||
Populate({&leaf, &middle, &root, &cycleX, &cycleY, &sharedChild, &multiRootA, &multiRootB});
|
||||
|
||||
m_leafFlatbuffer = leaf.Pack();
|
||||
m_middleFlatbuffer = middle.Pack();
|
||||
m_rootFlatbuffer = root.Pack();
|
||||
m_sharedChildFlatbuffer = sharedChild.Pack();
|
||||
m_multiRootAFlatbuffer = multiRootA.Pack();
|
||||
m_multiRootBFlatbuffer = multiRootB.Pack();
|
||||
}
|
||||
|
||||
void TearDown() override
|
||||
@@ -98,9 +108,7 @@ class SerializationManagerFixture: public ::testing::Test
|
||||
}
|
||||
|
||||
/*
|
||||
* Packs and writes p_assets to the real, on-disk backing store used by the current build (a BigFile in
|
||||
* ToolMode, a baked Sasquatch file in Game), then makes it the active DataAccessor. This lets LoadAsset and
|
||||
* LoadAssets be exercised against a real DataAccessor instead of a mocked one.
|
||||
* Packs and writes p_assets to the current data accessors (bigfile for tool/sasquatch for game)
|
||||
*
|
||||
* \param p_assets The assets to write, in insertion order
|
||||
*/
|
||||
@@ -168,31 +176,29 @@ class SerializationManagerFixture: public ::testing::Test
|
||||
AssetContainer<AssetC> m_containerC;
|
||||
|
||||
// An asset with no HardReferences of its own
|
||||
AssetA m_leaf;
|
||||
UUID m_leafUUID;
|
||||
eastl::vector<std::byte> m_leafFlatbuffer;
|
||||
|
||||
// HardReferences m_leaf
|
||||
AssetB m_middle;
|
||||
// HardReferences the leaf asset
|
||||
UUID m_middleUUID;
|
||||
eastl::vector<std::byte> m_middleFlatbuffer;
|
||||
|
||||
// HardReferences both m_middle and m_leaf directly
|
||||
AssetC m_root;
|
||||
// HardReferences both the middle and leaf assets directly
|
||||
UUID m_rootUUID;
|
||||
eastl::vector<std::byte> m_rootFlatbuffer;
|
||||
|
||||
// A pair of assets HardReferencing each other
|
||||
AssetB m_cycleX;
|
||||
AssetB m_cycleY;
|
||||
UUID m_cycleXUUID;
|
||||
UUID m_cycleYUUID;
|
||||
|
||||
// HardReferenced by both m_multiRootA and m_multiRootB
|
||||
AssetA m_sharedChild;
|
||||
// HardReferenced by both m_multiRootAUUID and m_multiRootBUUID
|
||||
UUID m_sharedChildUUID;
|
||||
eastl::vector<std::byte> m_sharedChildFlatbuffer;
|
||||
|
||||
AssetB m_multiRootA;
|
||||
UUID m_multiRootAUUID;
|
||||
AssetB m_multiRootB;
|
||||
eastl::vector<std::byte> m_multiRootAFlatbuffer;
|
||||
UUID m_multiRootBUUID;
|
||||
eastl::vector<std::byte> m_multiRootBFlatbuffer;
|
||||
|
||||
#if defined BIGFOOT_TOOLMODE
|
||||
eastl::optional<BigFile> m_bigFile;
|
||||
@@ -211,7 +217,7 @@ TEST_F(SerializationManagerFixture, LoadAsset_ShouldLoadAnAssetWithNoHardReferen
|
||||
SerializationManager::LoadAsset(m_leafUUID);
|
||||
|
||||
ASSERT_NE(leafRef.Get(), nullptr);
|
||||
EXPECT_EQ(leafRef.Get()->Pack(), m_leaf.Pack());
|
||||
EXPECT_EQ(leafRef.Get()->Pack(), m_leafFlatbuffer);
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
@@ -232,9 +238,9 @@ TEST_F(SerializationManagerFixture, LoadAsset_ShouldTransitivelyLoadEveryHardRef
|
||||
ASSERT_NE(middleRef.Get(), nullptr);
|
||||
ASSERT_NE(rootRef.Get(), nullptr);
|
||||
|
||||
EXPECT_EQ(leafRef.Get()->Pack(), m_leaf.Pack());
|
||||
EXPECT_EQ(middleRef.Get()->Pack(), m_middle.Pack());
|
||||
EXPECT_EQ(rootRef.Get()->Pack(), m_root.Pack());
|
||||
EXPECT_EQ(leafRef.Get()->Pack(), m_leafFlatbuffer);
|
||||
EXPECT_EQ(middleRef.Get()->Pack(), m_middleFlatbuffer);
|
||||
EXPECT_EQ(rootRef.Get()->Pack(), m_rootFlatbuffer);
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
@@ -289,9 +295,9 @@ TEST_F(SerializationManagerFixture, LoadAssets_ShouldLoadEveryRootAndMergeShared
|
||||
ASSERT_NE(rootARef.Get(), nullptr);
|
||||
ASSERT_NE(rootBRef.Get(), nullptr);
|
||||
|
||||
EXPECT_EQ(sharedChildRef.Get()->Pack(), m_sharedChild.Pack());
|
||||
EXPECT_EQ(rootARef.Get()->Pack(), m_multiRootA.Pack());
|
||||
EXPECT_EQ(rootBRef.Get()->Pack(), m_multiRootB.Pack());
|
||||
EXPECT_EQ(sharedChildRef.Get()->Pack(), m_sharedChildFlatbuffer);
|
||||
EXPECT_EQ(rootARef.Get()->Pack(), m_multiRootAFlatbuffer);
|
||||
EXPECT_EQ(rootBRef.Get()->Pack(), m_multiRootBFlatbuffer);
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user