All checks were successful
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 5m26s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 5m20s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 5m42s
Bigfoot / Build & Test Debug with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 5m37s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 5m45s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 5m48s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 7m0s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 6m56s
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: OFF) (push) Successful in 6m2s
Bigfoot / Build & Test Release with ./ConanProfiles/clang (Unity Build: ON) (push) Successful in 5m51s
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: OFF) (push) Successful in 6m29s
Bigfoot / Build & Test Release with ./ConanProfiles/clang_asan (Unity Build: ON) (push) Successful in 6m31s
Bigfoot / Clang Format Checks (push) Successful in 10s
39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
/*********************************************************************
|
|
* \file SlotMap.cpp
|
|
*
|
|
* \author Romain BOULLARD
|
|
* \date May 2026
|
|
*********************************************************************/
|
|
#include <Utils/Containers/SlotMap.hpp>
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
namespace Bigfoot
|
|
{
|
|
class SlotMapFixture: public ::testing::Test
|
|
{
|
|
protected:
|
|
SlotMap<std::uint32_t> m_slotMap;
|
|
};
|
|
|
|
TEST_F(SlotMapFixture, Insert)
|
|
{
|
|
const SlotMap<std::uint32_t>::SlotKey firstKey = m_slotMap.Insert(64);
|
|
const SlotMap<std::uint32_t>::SlotKey secondKey = m_slotMap.Insert(2);
|
|
const SlotMap<std::uint32_t>::SlotKey thirdKey = m_slotMap.Insert(42);
|
|
|
|
m_slotMap.Remove(secondKey);
|
|
m_slotMap.Remove(firstKey);
|
|
|
|
const SlotMap<std::uint32_t>::SlotKey fourthKey = m_slotMap.Insert(3);
|
|
const SlotMap<std::uint32_t>::SlotKey fifthKey = m_slotMap.Insert(65);
|
|
|
|
EXPECT_EQ(m_slotMap.Get(firstKey), nullptr);
|
|
EXPECT_EQ(m_slotMap.Get(secondKey), nullptr);
|
|
EXPECT_EQ(*m_slotMap.Get(thirdKey), 42);
|
|
EXPECT_EQ(*m_slotMap.Get(fourthKey), 3);
|
|
EXPECT_EQ(*m_slotMap.Get(fifthKey), 65);
|
|
EXPECT_EQ(m_slotMap.Get(SlotMap<std::uint32_t>::SlotKey {}), nullptr);
|
|
}
|
|
} // namespace Bigfoot
|