1 //===-- Unittests for isxdigit---------------------------------------------===//
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 //===----------------------------------------------------------------------===//
8 
9 #include "src/ctype/isxdigit.h"
10 #include "utils/UnitTest/Test.h"
11 
TEST(LlvmLibcIsXDigit,DefaultLocale)12 TEST(LlvmLibcIsXDigit, DefaultLocale) {
13   for (int ch = 0; ch < 255; ++ch) {
14     if (('0' <= ch && ch <= '9') || ('a' <= ch && ch <= 'f') ||
15         ('A' <= ch && ch <= 'F'))
16       EXPECT_NE(__llvm_libc::isxdigit(ch), 0);
17     else
18       EXPECT_EQ(__llvm_libc::isxdigit(ch), 0);
19   }
20 }
21