Make test more lenient for custom clang version strings
[llvm-project.git] / libc / test / src / wchar / wctob_test.cpp
blob977224bf77abe0ceda51ed9bbd6d0fad4220268c
1 //===-- Unittests for wctob ---------------------------------------------===//
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/stdio_macros.h" //for EOF
10 #include "src/wchar/wctob.h"
11 #include "test/UnitTest/Test.h"
13 TEST(LlvmLibcWctob, DefaultLocale) {
14 // Loops through a subset of the wide characters, verifying that ascii returns
15 // itself and everything else returns EOF.
16 for (wint_t c = 0; c < 32767; ++c) {
17 if (c < 128)
18 EXPECT_EQ(LIBC_NAMESPACE::wctob(c), static_cast<int>(c));
19 else
20 EXPECT_EQ(LIBC_NAMESPACE::wctob(c), EOF);