00b86fbd00
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Failing after 5m37s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled
Bigfoot / Clang Format Checks (push) Has been cancelled
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Has been cancelled
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Has been cancelled
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Has been cancelled
74 lines
2.0 KiB
C++
74 lines
2.0 KiB
C++
/*********************************************************************
|
|
* \file BigFile.cpp
|
|
*
|
|
* \author Romain BOULLARD
|
|
* \date December 2025
|
|
*********************************************************************/
|
|
#include <Engine/Asset/AssetContainer.hpp>
|
|
|
|
#include <EngineTests/Asset/AssetA.hpp>
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
namespace Bigfoot
|
|
{
|
|
class AssetContainerFixture: public ::testing::Test
|
|
{
|
|
protected:
|
|
AssetContainer<AssetA> m_container;
|
|
};
|
|
|
|
/****************************************************************************************/
|
|
|
|
TEST_F(AssetContainerFixture, Insert)
|
|
{
|
|
std::ignore = m_container.Insert();
|
|
}
|
|
|
|
/****************************************************************************************/
|
|
|
|
TEST_F(AssetContainerFixture, Get)
|
|
{
|
|
const auto key = m_container.Insert();
|
|
|
|
const auto& constContainer = m_container;
|
|
|
|
const auto validateKey = [&](auto& p_assetContainer)
|
|
{
|
|
const auto asset = p_assetContainer.Get(key);
|
|
EXPECT_NE(asset, nullptr);
|
|
};
|
|
validateKey(m_container);
|
|
validateKey(constContainer);
|
|
}
|
|
|
|
/****************************************************************************************/
|
|
|
|
TEST_F(AssetContainerFixture, GetSlotKey)
|
|
{
|
|
const auto key = m_container.Insert();
|
|
const auto asset = m_container.Get(key);
|
|
EXPECT_EQ(m_container.GetSlotKey(asset->GetHeader().uuid), key);
|
|
}
|
|
|
|
/****************************************************************************************/
|
|
|
|
TEST_F(AssetContainerFixture, Has)
|
|
{
|
|
const auto key = m_container.Insert();
|
|
EXPECT_TRUE(m_container.Has(key));
|
|
EXPECT_TRUE(m_container.Has(m_container.Get(key)->GetHeader().uuid));
|
|
}
|
|
|
|
/****************************************************************************************/
|
|
|
|
TEST_F(AssetContainerFixture, Remove)
|
|
{
|
|
const auto key1 = m_container.Insert();
|
|
m_container.Remove(key1);
|
|
|
|
const auto key2 = m_container.Insert();
|
|
m_container.Remove(m_container.Get(key2)->GetHeader().uuid);
|
|
}
|
|
} // namespace Bigfoot
|