1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

Add more tests for ESM::FixedString

This commit is contained in:
elsid 2023-01-02 17:21:36 +01:00
parent 7c60905266
commit c80ba92ab7
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

View File

@ -37,6 +37,7 @@ namespace
EXPECT_TRUE(name == ss);
}
}
TEST(EsmFixedString, operator__eq_ne_const)
{
{
@ -143,4 +144,30 @@ namespace
constexpr ESM::NAME value(ESM::RecNameInts::REC_ACTI);
EXPECT_EQ(value, static_cast<std::uint32_t>(ESM::RecNameInts::REC_ACTI)) << value.toInt();
}
TEST(EsmFixedString, equality_operator_for_not_convertible_to_uint32_with_string_literal)
{
const ESM::FixedString<5> value("abcd");
EXPECT_EQ(value, "abcd");
}
TEST(EsmFixedString, equality_operator_for_not_convertible_to_uint32_with_fixed_size_char_array)
{
const ESM::FixedString<5> value("abcd");
const char other[5] = { 'a', 'b', 'c', 'd', '\0' };
EXPECT_EQ(value, other);
}
TEST(EsmFixedString, equality_operator_for_not_convertible_to_uint32_with_const_char_pointer)
{
const ESM::FixedString<5> value("abcd");
const char other[5] = { 'a', 'b', 'c', 'd', '\0' };
EXPECT_EQ(value, static_cast<const char*>(other));
}
TEST(EsmFixedString, equality_operator_for_not_convertible_to_uint32_with_string)
{
const ESM::FixedString<5> value("abcd");
EXPECT_EQ(value, std::string("abcd"));
}
}