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" 10af1315c2SSiva Chandra Reddy #include "test/UnitTest/Test.h" 111fcfd30fSPaula Toth TEST(LlvmLibcStrLenTest,EmptyString)121df0dbfcSMichael JonesTEST(LlvmLibcStrLenTest, EmptyString) { 131fcfd30fSPaula Toth const char *empty = ""; 141fcfd30fSPaula Toth 15*b6bc9d72SGuillaume Chatelet size_t result = LIBC_NAMESPACE::strlen(empty); 161fcfd30fSPaula Toth ASSERT_EQ((size_t)0, result); 171fcfd30fSPaula Toth } 181fcfd30fSPaula Toth TEST(LlvmLibcStrLenTest,AnyString)191df0dbfcSMichael JonesTEST(LlvmLibcStrLenTest, AnyString) { 201fcfd30fSPaula Toth const char *any = "Hello World!"; 211fcfd30fSPaula Toth 22*b6bc9d72SGuillaume Chatelet size_t result = LIBC_NAMESPACE::strlen(any); 231fcfd30fSPaula Toth ASSERT_EQ((size_t)12, result); 241fcfd30fSPaula Toth } 25