formatting unit tests + pack/unpack unit tests
Bigfoot / Sonarqube (push) Skipped
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 1m0s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: game) (push) Failing after 18s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m5s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Failing after 21s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: game) (push) Successful in 37s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: ON, Variant: game) (push) Failing after 22s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 40s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Failing after 25s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: game) (push) Successful in 34s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: ON, Variant: game) (push) Failing after 17s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 38s
Bigfoot / Build & Test Debug with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Failing after 20s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 1m2s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: game) (push) Failing after 28s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m7s
Bigfoot / Build & Test RelWithDebInfo with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Failing after 32s
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 25s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 48s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang (Unity Build: ON, Variant: toolmode) (push) Successful in 39s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 46s
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 50s
Bigfoot / Build & Test Release with ./ConanProfiles/host/clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 43s
Bigfoot / Clang Format Checks (push) Successful in 10s

This commit is contained in:
2026-08-30 13:37:56 +02:00
parent b2a9a9209e
commit 41a0758679
5 changed files with 90 additions and 2 deletions
@@ -114,7 +114,6 @@ class Version
/****************************************************************************************/
#if defined BIGFOOT_NOT_OPTIMIZED
template<>
struct fmt::formatter<Bigfoot::Version>
{
@@ -131,4 +130,3 @@ struct fmt::formatter<Bigfoot::Version>
}
};
#endif
#endif
@@ -0,0 +1,34 @@
/*********************************************************************
* \file AssetTypeID.cpp
*
* \author Romain BOULLARD
* \date August 2026
*********************************************************************/
#include <Engine/Asset/AssetTypeID.hpp>
#include <Engine/Asset/AssetTypeID_generated.hpp>
#include <gtest/gtest.h>
#include <limits>
namespace Bigfoot
{
TEST(AssetTypeID, Pack_ShouldGiveAFlatAssetTypeIDWithTheSameValue)
{
constexpr AssetTypeID assetTypeID = 42;
const Flat::Bigfoot::AssetTypeID flatAssetTypeID = flatbuffers::Pack(assetTypeID);
EXPECT_EQ(flatAssetTypeID.value(), assetTypeID);
}
/****************************************************************************************/
TEST(AssetTypeID, UnPack_ShouldGiveBackTheOriginalValue)
{
constexpr AssetTypeID assetTypeID = 42;
const Flat::Bigfoot::AssetTypeID flatAssetTypeID = flatbuffers::Pack(assetTypeID);
EXPECT_EQ(flatbuffers::UnPack(flatAssetTypeID), assetTypeID);
}
} // namespace Bigfoot
+18
View File
@@ -6,6 +6,8 @@
*********************************************************************/
#include <System/Time/Time.hpp>
#include <System/Time/Time_generated.hpp>
#include <gtest/gtest.h>
namespace Bigfoot
@@ -64,4 +66,20 @@ TEST_F(TimeFixture, GetMicrosecond_ShouldReturnTheMicrosecond)
{
EXPECT_EQ(m_time.GetMicrosecond(), 680'609);
}
/****************************************************************************************/
TEST_F(TimeFixture, Pack_ShouldGiveAFlatTimeWithTheSameEpoch)
{
const Flat::Bigfoot::Time flatTime = flatbuffers::Pack(m_time);
EXPECT_EQ(flatTime.epoch(), m_time.GetEpoch());
}
/****************************************************************************************/
TEST_F(TimeFixture, UnPack_ShouldGiveBackTheOriginalTime)
{
const Flat::Bigfoot::Time flatTime = flatbuffers::Pack(m_time);
EXPECT_EQ(flatbuffers::UnPack(flatTime), m_time);
}
} // namespace Bigfoot
+30
View File
@@ -6,6 +6,8 @@
*********************************************************************/
#include <System/UUID/UUID.hpp>
#include <System/UUID/UUID_generated.hpp>
#include <ankerl/unordered_dense.h>
#include <gtest/gtest.h>
@@ -178,4 +180,32 @@ TEST_F(UUIDFixture, ToBytes_ShouldGiveBackTheRawDataOfTheID)
EXPECT_EQ(d[i], raw[i]);
}
}
/****************************************************************************************/
TEST_F(UUIDFixture, Pack_ShouldGiveAFlatUUIDWithTheSameRawBytes)
{
const Flat::Bigfoot::UUID flatUUID = flatbuffers::Pack(m_d);
for (std::uint32_t i = 0; i < UUID::UUID_BYTE_SIZE; ++i)
{
EXPECT_EQ(std::byte {(*flatUUID.bytes())[i]}, m_raw[i]);
}
}
/****************************************************************************************/
TEST_F(UUIDFixture, UnPack_ShouldGiveBackTheOriginalUUID)
{
const Flat::Bigfoot::UUID flatUUID = flatbuffers::Pack(m_d);
EXPECT_EQ(flatbuffers::UnPack(flatUUID), m_d);
}
/****************************************************************************************/
TEST_F(UUIDFixture, FormatsUUID)
{
EXPECT_EQ(fmt::format("{}", m_b), m_b.ToString());
EXPECT_EQ(fmt::format("{}", UUID::NULL_UUID), "00000000-0000-0000-0000-000000000000");
}
} // namespace Bigfoot
+8
View File
@@ -70,4 +70,12 @@ TEST_F(VersionFixture, Comparisons)
EXPECT_EQ(other, other);
EXPECT_NE(other, m_detailed);
}
/****************************************************************************************/
TEST_F(VersionFixture, FormatsVersion)
{
EXPECT_EQ(fmt::format("{}", m_detailed), "1.2.3");
EXPECT_EQ(fmt::format("{}", m_combined), "1.2.3");
}
} // namespace Bigfoot