Skip to content

Commit

Permalink
Updates to constexpr char traits tests
Browse files Browse the repository at this point in the history
  • Loading branch information
John Wellbelove committed Aug 6, 2024
1 parent bceca90 commit f33b4d7
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions test/test_char_traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,32 @@ namespace
//*************************************************************************
TEST(test_strlen)
{
char data1[etl::strlen("qwerty")];
char data2[etl::strlen(L"qwerty")];
char data3[etl::strlen(u"qwerty")];
char data4[etl::strlen(U"qwerty")];
CHECK_EQUAL(6U, etl::strlen("qwerty"));
CHECK_EQUAL(6U, etl::strlen(L"qwerty"));
CHECK_EQUAL(6U, etl::strlen(u"qwerty"));
CHECK_EQUAL(6U, etl::strlen(U"qwerty"));
}

#if ETL_USING_CPP14 && !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_strlen_constexpr)
{
constexpr size_t Size1 = etl::strlen("qwerty");
constexpr size_t Size2 = etl::strlen(L"qwerty");
constexpr size_t Size3 = etl::strlen(u"qwerty");
constexpr size_t Size4 = etl::strlen(U"qwerty");

char data1[Size1];
char data2[Size2];
char data3[Size3];
char data4[Size4];

CHECK_EQUAL(6U, sizeof(data1));
CHECK_EQUAL(6U, sizeof(data2));
CHECK_EQUAL(6U, sizeof(data3));
CHECK_EQUAL(6U, sizeof(data4));
}
#endif

//*************************************************************************
TEST(test_strcmp_char)
Expand Down

0 comments on commit f33b4d7

Please sign in to comment.