166d00febSPaula Toth //===-- Unittests for strlen ----------------------------------------------===//
21fcfd30fSPaula Toth //
31fcfd30fSPaula Toth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
41fcfd30fSPaula Toth // See https://llvm.org/LICENSE.txt for license information.
51fcfd30fSPaula Toth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
61fcfd30fSPaula Toth //
71fcfd30fSPaula Toth //===----------------------------------------------------------------------===//
81fcfd30fSPaula Toth 
91fcfd30fSPaula Toth #include "src/string/strlen.h"
101fcfd30fSPaula Toth #include "utils/UnitTest/Test.h"
111fcfd30fSPaula Toth 
TEST(LlvmLibcStrLenTest,EmptyString)12*1df0dbfcSMichael Jones TEST(LlvmLibcStrLenTest, EmptyString) {
131fcfd30fSPaula Toth   const char *empty = "";
141fcfd30fSPaula Toth 
151fcfd30fSPaula Toth   size_t result = __llvm_libc::strlen(empty);
161fcfd30fSPaula Toth   ASSERT_EQ((size_t)0, result);
171fcfd30fSPaula Toth }
181fcfd30fSPaula Toth 
TEST(LlvmLibcStrLenTest,AnyString)19*1df0dbfcSMichael Jones TEST(LlvmLibcStrLenTest, AnyString) {
201fcfd30fSPaula Toth   const char *any = "Hello World!";
211fcfd30fSPaula Toth 
221fcfd30fSPaula Toth   size_t result = __llvm_libc::strlen(any);
231fcfd30fSPaula Toth   ASSERT_EQ((size_t)12, result);
241fcfd30fSPaula Toth }
25