X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrlen.c;h=4856d99502254f07569e494c7103ebe183709122;hb=b1fc26afebd4d557ff89a44bc21767a8704c3809;hp=c862805ed74840f0e5b906e3cf2008beb1beef43;hpb=bdaff7ee88189505e6b66699571034aed015a3bd;p=pdclib diff --git a/functions/string/strlen.c b/functions/string/strlen.c index c862805..4856d99 100644 --- a/functions/string/strlen.c +++ b/functions/string/strlen.c @@ -1,7 +1,3 @@ -/* $Id$ */ - -/* Release $Name$ */ - /* strlen( const char * ) This file is part of the Public Domain C Library (PDCLib). @@ -10,6 +6,8 @@ #include +#ifndef REGTEST + size_t strlen( const char * s ) { size_t rc = 0; @@ -20,4 +18,15 @@ size_t strlen( const char * s ) return rc; } -#warning Test driver missing. +#endif + +#ifdef TEST +#include <_PDCLIB_test.h> + +int main( void ) +{ + TESTCASE( strlen( abcde ) == 5 ); + TESTCASE( strlen( "" ) == 0 ); + return TEST_RESULTS; +} +#endif