1 //===-- Unittests for strcoll ---------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 #include "src/string/strcoll.h"
10 #include "test/UnitTest/Test.h"
12 // TODO: Add more comprehensive tests once locale support is added.
14 TEST(LlvmLibcStrcollTest
, SimpleTest
) {
15 const char *s1
= "abc";
16 const char *s2
= "abc";
17 const char *s3
= "def";
18 int result
= LIBC_NAMESPACE::strcoll(s1
, s2
);
21 // Verify operands reversed.
22 result
= LIBC_NAMESPACE::strcoll(s2
, s1
);
25 result
= LIBC_NAMESPACE::strcoll(s1
, s3
);
28 result
= LIBC_NAMESPACE::strcoll(s3
, s1
);