Skip to content

Commit 40736e7

Browse files
committed
header
1 parent e203b50 commit 40736e7

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

libc/test/src/strings/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ add_libc_test(
8181
SRCS
8282
strcasecmp_l_test.cpp
8383
DEPENDS
84+
libc.include.locale
8485
libc.src.locale.freelocale
8586
libc.src.locale.newlocale
8687
libc.src.strings.strcasecmp_l
@@ -103,6 +104,7 @@ add_libc_test(
103104
SRCS
104105
strncasecmp_l_test.cpp
105106
DEPENDS
107+
libc.include.locale
106108
libc.src.locale.freelocale
107109
libc.src.locale.newlocale
108110
libc.src.strings.strncasecmp_l

libc/test/src/strings/strcasecmp_l_test.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#include "include/llvm-libc-macros/locale-macros.h"
910
#include "src/locale/freelocale.h"
1011
#include "src/locale/newlocale.h"
1112
#include "src/strings/strcasecmp_l.h"
1213
#include "test/UnitTest/Test.h"
1314

1415
TEST(LlvmLibcStrCaseCmpLTest, Case) {
15-
locale_t locale = newlocale(LC_ALL, "C", nullptr);
16-
ASSERT_EQ(strcasecmp_l("hello", "HELLO", locale), 0);
17-
ASSERT_LT(strcasecmp_l("hello1", "hello2", locale), 0);
18-
ASSERT_GT(strcasecmp_l("hello2", "hello1", locale), 0);
19-
freelocale(locale);
16+
locale_t locale = LIBC_NAMESPACE::newlocale(LC_ALL, "C", nullptr);
17+
ASSERT_EQ(LIBC_NAMESPACE::strcasecmp_l("hello", "HELLO", locale), 0);
18+
ASSERT_LT(LIBC_NAMESPACE::strcasecmp_l("hello1", "hello2", locale), 0);
19+
ASSERT_GT(LIBC_NAMESPACE::strcasecmp_l("hello2", "hello1", locale), 0);
20+
LIBC_NAMESPACE::freelocale(locale);
2021
}

libc/test/src/strings/strncasecmp_l_test.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#include "include/llvm-libc-macros/locale-macros.h"
910
#include "src/locale/freelocale.h"
1011
#include "src/locale/newlocale.h"
1112
#include "src/strings/strncasecmp_l.h"
1213
#include "test/UnitTest/Test.h"
1314

1415
TEST(LlvmLibcStrNCaseCmpLTest, Case) {
15-
locale_t locale = newlocale(LC_ALL, "C", nullptr);
16-
ASSERT_EQ(0, strncasecmp_l("hello", "HELLO", 3, locale));
17-
ASSERT_EQ(0, strncasecmp_l("abcXX", "ABCYY", 3, locale));
18-
ASSERT_LT(strncasecmp_l("hello1", "hello2", 6, locale), 0);
19-
ASSERT_GT(strncasecmp_l("hello2", "hello1", 6, locale), 0);
20-
freelocale(locale);
16+
locale_t locale = LIBC_NAMESPACE::newlocale(LC_ALL, "C", nullptr);
17+
ASSERT_EQ(LIBC_NAMESPACE::strncasecmp_l("hello", "HELLO", 3, locale), 0);
18+
ASSERT_EQ(LIBC_NAMESPACE::strncasecmp_l("abcXX", "ABCYY", 3, locale), 0);
19+
ASSERT_LT(LIBC_NAMESPACE::strncasecmp_l("hello1", "hello2", 6, locale), 0);
20+
ASSERT_GT(LIBC_NAMESPACE::strncasecmp_l("hello2", "hello1", 6, locale), 0);
21+
LIBC_NAMESPACE::freelocale(locale);
2122
}

0 commit comments

Comments
 (0)