EqualNoCase
Bigfoot / Build & Test Debug with clang (Unity Build: OFF, Variant: game) (push) Successful in 1m4s
Bigfoot / Build & Test Debug with clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m5s
Bigfoot / Build & Test Debug with clang (Unity Build: ON, Variant: toolmode) (push) Successful in 47s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 2m9s
Bigfoot / Sonarqube (game) (push) Skipped
Bigfoot / Sonarqube (toolmode) (push) Skipped
Bigfoot / Build & Test Debug with clang (Unity Build: ON, Variant: game) (push) Successful in 42s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 2m9s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: ON, Variant: game) (push) Successful in 1m40s
Bigfoot / Build & Test Release with clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m19s
Bigfoot / Build & Test Release with clang (Unity Build: ON, Variant: toolmode) (push) Successful in 1m6s
Bigfoot / Build & Test Release with clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m44s
Bigfoot / Build & Test Release with clang_asan (Unity Build: ON, Variant: game) (push) Successful in 1m27s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 1m46s
Bigfoot / Build & Test Release with clang (Unity Build: OFF, Variant: game) (push) Successful in 59s
Bigfoot / Build & Test Release with clang (Unity Build: ON, Variant: game) (push) Successful in 48s
Bigfoot / Build & Test Release with clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 1m38s
Bigfoot / Build & Test Release with clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 1m31s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: ON, Variant: game) (push) Successful in 47s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 2m18s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 2m18s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: ON, Variant: game) (push) Successful in 1m44s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: OFF, Variant: game) (push) Successful in 1m7s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m16s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: ON, Variant: toolmode) (push) Successful in 53s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 1m52s
Bigfoot / Clang Format Checks (push) Successful in 10s
Bigfoot / Build & Test Debug with clang (Unity Build: OFF, Variant: game) (push) Successful in 1m4s
Bigfoot / Build & Test Debug with clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m5s
Bigfoot / Build & Test Debug with clang (Unity Build: ON, Variant: toolmode) (push) Successful in 47s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 2m9s
Bigfoot / Sonarqube (game) (push) Skipped
Bigfoot / Sonarqube (toolmode) (push) Skipped
Bigfoot / Build & Test Debug with clang (Unity Build: ON, Variant: game) (push) Successful in 42s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 2m9s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: ON, Variant: game) (push) Successful in 1m40s
Bigfoot / Build & Test Release with clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m19s
Bigfoot / Build & Test Release with clang (Unity Build: ON, Variant: toolmode) (push) Successful in 1m6s
Bigfoot / Build & Test Release with clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m44s
Bigfoot / Build & Test Release with clang_asan (Unity Build: ON, Variant: game) (push) Successful in 1m27s
Bigfoot / Build & Test Debug with clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 1m46s
Bigfoot / Build & Test Release with clang (Unity Build: OFF, Variant: game) (push) Successful in 59s
Bigfoot / Build & Test Release with clang (Unity Build: ON, Variant: game) (push) Successful in 48s
Bigfoot / Build & Test Release with clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 1m38s
Bigfoot / Build & Test Release with clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 1m31s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: ON, Variant: game) (push) Successful in 47s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: OFF, Variant: game) (push) Successful in 2m18s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: OFF, Variant: toolmode) (push) Successful in 2m18s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: ON, Variant: game) (push) Successful in 1m44s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: OFF, Variant: game) (push) Successful in 1m7s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: OFF, Variant: toolmode) (push) Successful in 1m16s
Bigfoot / Build & Test RelWithDebInfo with clang (Unity Build: ON, Variant: toolmode) (push) Successful in 53s
Bigfoot / Build & Test RelWithDebInfo with clang_asan (Unity Build: ON, Variant: toolmode) (push) Successful in 1m52s
Bigfoot / Clang Format Checks (push) Successful in 10s
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/*********************************************************************
|
||||
* \file String.hpp
|
||||
*
|
||||
* \author Romain BOULLARD
|
||||
* \date September 2026
|
||||
*********************************************************************/
|
||||
#ifndef BIGFOOT_UTILS_STRING_HPP
|
||||
#define BIGFOOT_UTILS_STRING_HPP
|
||||
#include <EASTL/string_view.h>
|
||||
|
||||
namespace Bigfoot
|
||||
{
|
||||
/**
|
||||
* Check if p_a and p_b are equal, ignoring case
|
||||
*
|
||||
* \param p_a The first string
|
||||
* \param p_b The second string
|
||||
* \return True if p_a and p_b are equal, false otherwise
|
||||
*/
|
||||
[[nodiscard]]
|
||||
bool EqualNoCase(eastl::string_view p_a, eastl::string_view p_b);
|
||||
} // namespace Bigfoot
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,35 @@
|
||||
/*********************************************************************
|
||||
* \file String.cpp
|
||||
*
|
||||
* \author Romain BOULLARD
|
||||
* \date September 2026
|
||||
*********************************************************************/
|
||||
#include <Utils/String.hpp>
|
||||
|
||||
#include <EASTL/algorithm.h>
|
||||
|
||||
#include <cctype>
|
||||
|
||||
namespace Bigfoot
|
||||
{
|
||||
bool EqualNoCase(const eastl::string_view p_a, const eastl::string_view p_b)
|
||||
{
|
||||
if (p_a.size() != p_b.size())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto toLower = [](const char p_character)
|
||||
{
|
||||
return static_cast<char>(std::tolower(static_cast<unsigned char>(p_character)));
|
||||
};
|
||||
|
||||
return eastl::equal(p_a.begin(),
|
||||
p_a.end(),
|
||||
p_b.begin(),
|
||||
[&toLower](const char p_x, const char p_y)
|
||||
{
|
||||
return toLower(p_x) == toLower(p_y);
|
||||
});
|
||||
}
|
||||
} // namespace Bigfoot
|
||||
@@ -0,0 +1,32 @@
|
||||
/*********************************************************************
|
||||
* \file String.cpp
|
||||
*
|
||||
* \author Romain BOULLARD
|
||||
* \date September 2026
|
||||
*********************************************************************/
|
||||
#include <Utils/String.hpp>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace Bigfoot
|
||||
{
|
||||
class StringFixture: public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
};
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
TEST_F(StringFixture, EqualNoCase_ShouldReturnTrueForTheSameStringWithDifferentCasing)
|
||||
{
|
||||
EXPECT_TRUE(EqualNoCase("NVIDIA GeForce RTX 5080", "nvidia geforce rtx 5080"));
|
||||
EXPECT_TRUE(EqualNoCase("NVIDIA GeForce RTX 5080", "NVIDIA GeForce RTX 5080"));
|
||||
}
|
||||
|
||||
/****************************************************************************************/
|
||||
|
||||
TEST_F(StringFixture, EqualNoCase_ShouldReturnFalseForDifferentStrings)
|
||||
{
|
||||
EXPECT_FALSE(EqualNoCase("NVIDIA GeForce RTX 5080", "AMD Radeon RX 7900"));
|
||||
}
|
||||
} // namespace Bigfoot
|
||||
Reference in New Issue
Block a user