1 //===-- Unittests for strcat ----------------------------------------------===//
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/strcat.h"
10 #include "test/UnitTest/Test.h"
12 TEST(LlvmLibcStrCatTest
, EmptyDest
) {
13 const char *abc
= "abc";
18 char *result
= LIBC_NAMESPACE::strcat(dest
, abc
);
19 ASSERT_EQ(dest
, result
);
20 ASSERT_STREQ(dest
, result
);
21 ASSERT_STREQ(dest
, abc
);
24 TEST(LlvmLibcStrCatTest
, NonEmptyDest
) {
25 const char *abc
= "abc";
33 char *result
= LIBC_NAMESPACE::strcat(dest
, abc
);
34 ASSERT_EQ(dest
, result
);
35 ASSERT_STREQ(dest
, result
);
36 ASSERT_STREQ(dest
, "xyzabc");