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);
|
std::ignore = m_library.Insert(&m_containerC);
|
||||||
|
|
||||||
// leaf
|
// leaf
|
||||||
m_leaf.SetName("leaf");
|
AssetA leaf;
|
||||||
m_leafUUID = m_leaf.GetHeader().uuid;
|
leaf.SetName("leaf");
|
||||||
|
m_leafUUID = leaf.GetHeader().uuid;
|
||||||
|
|
||||||
// middle --> leaf
|
// middle --> leaf
|
||||||
m_middle.SetName("middle");
|
AssetB middle;
|
||||||
m_middle.GetAsset().ref_a = HardReference<AssetA> {m_leafUUID};
|
middle.SetName("middle");
|
||||||
m_middleUUID = m_middle.GetHeader().uuid;
|
middle.GetAsset().ref_a = HardReference<AssetA> {m_leafUUID};
|
||||||
|
m_middleUUID = middle.GetHeader().uuid;
|
||||||
|
|
||||||
// root
|
// root
|
||||||
// / \
|
// / \
|
||||||
// v v
|
// v v
|
||||||
// middle --> leaf
|
// middle --> leaf
|
||||||
//
|
AssetC root;
|
||||||
// root HardReferences both middle and leaf directly, so leaf ends up shared by two different paths
|
root.GetAsset().asset_b_ref = HardReference<AssetB> {m_middleUUID};
|
||||||
m_root.GetAsset().asset_b_ref = HardReference<AssetB> {m_middleUUID};
|
root.GetAsset().inner_table->asset_a_ref = HardReference<AssetA> {m_leafUUID};
|
||||||
m_root.GetAsset().inner_table->asset_a_ref = HardReference<AssetA> {m_leafUUID};
|
m_rootUUID = root.GetHeader().uuid;
|
||||||
m_rootUUID = m_root.GetHeader().uuid;
|
|
||||||
|
|
||||||
// cycleX <--> cycleY
|
// cycleX <--> cycleY
|
||||||
//
|
AssetB cycleX;
|
||||||
// ref_a is typed as a HardReference<AssetA>, but a HardReference only carries a UUID: reusing it to point
|
AssetB cycleY;
|
||||||
// at another AssetB is enough to form a cycle for this test
|
cycleX.GetAsset().ref_a = HardReference<AssetA> {cycleY.GetHeader().uuid};
|
||||||
m_cycleX.GetAsset().ref_a = HardReference<AssetA> {m_cycleY.GetHeader().uuid};
|
cycleY.GetAsset().ref_a = HardReference<AssetA> {cycleX.GetHeader().uuid};
|
||||||
m_cycleY.GetAsset().ref_a = HardReference<AssetA> {m_cycleX.GetHeader().uuid};
|
m_cycleXUUID = cycleX.GetHeader().uuid;
|
||||||
m_cycleXUUID = m_cycleX.GetHeader().uuid;
|
m_cycleYUUID = cycleY.GetHeader().uuid;
|
||||||
m_cycleYUUID = m_cycleY.GetHeader().uuid;
|
|
||||||
|
|
||||||
// sharedChild
|
// sharedChild
|
||||||
m_sharedChild.SetName("shared");
|
AssetA sharedChild;
|
||||||
m_sharedChildUUID = m_sharedChild.GetHeader().uuid;
|
sharedChild.SetName("shared");
|
||||||
|
m_sharedChildUUID = sharedChild.GetHeader().uuid;
|
||||||
|
|
||||||
// multiRootA multiRootB
|
// multiRootA multiRootB
|
||||||
// \ /
|
// \ /
|
||||||
// v v
|
// v v
|
||||||
// sharedChild
|
// sharedChild
|
||||||
m_multiRootA.SetName("rootA");
|
AssetB multiRootA;
|
||||||
m_multiRootA.GetAsset().ref_a = HardReference<AssetA> {m_sharedChildUUID};
|
multiRootA.SetName("rootA");
|
||||||
m_multiRootAUUID = m_multiRootA.GetHeader().uuid;
|
multiRootA.GetAsset().ref_a = HardReference<AssetA> {m_sharedChildUUID};
|
||||||
|
m_multiRootAUUID = multiRootA.GetHeader().uuid;
|
||||||
|
|
||||||
m_multiRootB.SetName("rootB");
|
AssetB multiRootB;
|
||||||
m_multiRootB.GetAsset().ref_a = HardReference<AssetA> {m_sharedChildUUID};
|
multiRootB.SetName("rootB");
|
||||||
m_multiRootBUUID = m_multiRootB.GetHeader().uuid;
|
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
|
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
|
* Packs and writes p_assets to the current data accessors (bigfile for tool/sasquatch for game)
|
||||||
* 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.
|
|
||||||
*
|
*
|
||||||
* \param p_assets The assets to write, in insertion order
|
* \param p_assets The assets to write, in insertion order
|
||||||
*/
|
*/
|
||||||
@@ -168,31 +176,29 @@ class SerializationManagerFixture: public ::testing::Test
|
|||||||
AssetContainer<AssetC> m_containerC;
|
AssetContainer<AssetC> m_containerC;
|
||||||
|
|
||||||
// An asset with no HardReferences of its own
|
// An asset with no HardReferences of its own
|
||||||
AssetA m_leaf;
|
|
||||||
UUID m_leafUUID;
|
UUID m_leafUUID;
|
||||||
|
eastl::vector<std::byte> m_leafFlatbuffer;
|
||||||
|
|
||||||
// HardReferences m_leaf
|
// HardReferences the leaf asset
|
||||||
AssetB m_middle;
|
|
||||||
UUID m_middleUUID;
|
UUID m_middleUUID;
|
||||||
|
eastl::vector<std::byte> m_middleFlatbuffer;
|
||||||
|
|
||||||
// HardReferences both m_middle and m_leaf directly
|
// HardReferences both the middle and leaf assets directly
|
||||||
AssetC m_root;
|
|
||||||
UUID m_rootUUID;
|
UUID m_rootUUID;
|
||||||
|
eastl::vector<std::byte> m_rootFlatbuffer;
|
||||||
|
|
||||||
// A pair of assets HardReferencing each other
|
// A pair of assets HardReferencing each other
|
||||||
AssetB m_cycleX;
|
|
||||||
AssetB m_cycleY;
|
|
||||||
UUID m_cycleXUUID;
|
UUID m_cycleXUUID;
|
||||||
UUID m_cycleYUUID;
|
UUID m_cycleYUUID;
|
||||||
|
|
||||||
// HardReferenced by both m_multiRootA and m_multiRootB
|
// HardReferenced by both m_multiRootAUUID and m_multiRootBUUID
|
||||||
AssetA m_sharedChild;
|
|
||||||
UUID m_sharedChildUUID;
|
UUID m_sharedChildUUID;
|
||||||
|
eastl::vector<std::byte> m_sharedChildFlatbuffer;
|
||||||
|
|
||||||
AssetB m_multiRootA;
|
|
||||||
UUID m_multiRootAUUID;
|
UUID m_multiRootAUUID;
|
||||||
AssetB m_multiRootB;
|
eastl::vector<std::byte> m_multiRootAFlatbuffer;
|
||||||
UUID m_multiRootBUUID;
|
UUID m_multiRootBUUID;
|
||||||
|
eastl::vector<std::byte> m_multiRootBFlatbuffer;
|
||||||
|
|
||||||
#if defined BIGFOOT_TOOLMODE
|
#if defined BIGFOOT_TOOLMODE
|
||||||
eastl::optional<BigFile> m_bigFile;
|
eastl::optional<BigFile> m_bigFile;
|
||||||
@@ -211,7 +217,7 @@ TEST_F(SerializationManagerFixture, LoadAsset_ShouldLoadAnAssetWithNoHardReferen
|
|||||||
SerializationManager::LoadAsset(m_leafUUID);
|
SerializationManager::LoadAsset(m_leafUUID);
|
||||||
|
|
||||||
ASSERT_NE(leafRef.Get(), nullptr);
|
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(middleRef.Get(), nullptr);
|
||||||
ASSERT_NE(rootRef.Get(), nullptr);
|
ASSERT_NE(rootRef.Get(), nullptr);
|
||||||
|
|
||||||
EXPECT_EQ(leafRef.Get()->Pack(), m_leaf.Pack());
|
EXPECT_EQ(leafRef.Get()->Pack(), m_leafFlatbuffer);
|
||||||
EXPECT_EQ(middleRef.Get()->Pack(), m_middle.Pack());
|
EXPECT_EQ(middleRef.Get()->Pack(), m_middleFlatbuffer);
|
||||||
EXPECT_EQ(rootRef.Get()->Pack(), m_root.Pack());
|
EXPECT_EQ(rootRef.Get()->Pack(), m_rootFlatbuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************************/
|
/****************************************************************************************/
|
||||||
@@ -289,9 +295,9 @@ TEST_F(SerializationManagerFixture, LoadAssets_ShouldLoadEveryRootAndMergeShared
|
|||||||
ASSERT_NE(rootARef.Get(), nullptr);
|
ASSERT_NE(rootARef.Get(), nullptr);
|
||||||
ASSERT_NE(rootBRef.Get(), nullptr);
|
ASSERT_NE(rootBRef.Get(), nullptr);
|
||||||
|
|
||||||
EXPECT_EQ(sharedChildRef.Get()->Pack(), m_sharedChild.Pack());
|
EXPECT_EQ(sharedChildRef.Get()->Pack(), m_sharedChildFlatbuffer);
|
||||||
EXPECT_EQ(rootARef.Get()->Pack(), m_multiRootA.Pack());
|
EXPECT_EQ(rootARef.Get()->Pack(), m_multiRootAFlatbuffer);
|
||||||
EXPECT_EQ(rootBRef.Get()->Pack(), m_multiRootB.Pack());
|
EXPECT_EQ(rootBRef.Get()->Pack(), m_multiRootBFlatbuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************************/
|
/****************************************************************************************/
|
||||||
|
|||||||
Reference in New Issue
Block a user