[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / libc / test / src / wchar / btowc_test.cpp
blob8479d541a20ee95c3f0ad2f5d53d9b08a78f34ec
1 //===-- Unittests for btowc ---------------------------------------------===//
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 "hdr/wchar_macros.h" // for WEOF
10 #include "src/wchar/btowc.h"
11 #include "test/UnitTest/Test.h"
13 TEST(LlvmLibcBtowc, DefaultLocale) {
14 // Loops through all characters, verifying that ascii returns itself and
15 // everything else returns WEOF.
16 for (int c = 0; c < 255; ++c) {
17 if (c < 128)
18 EXPECT_EQ(LIBC_NAMESPACE::btowc(c), static_cast<wint_t>(c));
19 else
20 EXPECT_EQ(LIBC_NAMESPACE::btowc(c), WEOF);