Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libc / test / src / locale / locale_test.cpp
blobbc48bb851f4e4c96b36b4083feeecd346da6af8c
1 //===-- Unittests for locale ----------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "src/locale/freelocale.h"
10 #include "src/locale/newlocale.h"
11 #include "src/locale/uselocale.h"
13 #include "test/UnitTest/Test.h"
15 #include "include/llvm-libc-macros/locale-macros.h"
17 TEST(LlvmLibcLocale, DefaultLocale) {
18 locale_t new_locale = LIBC_NAMESPACE::newlocale(LC_ALL, "C", nullptr);
19 EXPECT_NE(new_locale, static_cast<locale_t>(nullptr));
21 locale_t old_locale = LIBC_NAMESPACE::uselocale(new_locale);
22 EXPECT_NE(old_locale, static_cast<locale_t>(nullptr));
24 LIBC_NAMESPACE::freelocale(new_locale);
26 LIBC_NAMESPACE::uselocale(old_locale);