X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrlen.c;h=14686bbba734bcd08f3a6296748329eafbafc481;hb=12e17136786afb1775c9dc946cbe41f5e230c24a;hp=da5bc4093af805dddfdcf274f12cc19f6704f6e5;hpb=1d1bcc009f3ebb75d549b078cfd0017f1298fae3;p=pdclib.old diff --git a/functions/string/strlen.c b/functions/string/strlen.c index da5bc40..14686bb 100644 --- a/functions/string/strlen.c +++ b/functions/string/strlen.c @@ -10,6 +10,8 @@ #include +#ifndef REGTEST + size_t strlen( const char * s ) { size_t rc = 0; @@ -20,11 +22,15 @@ size_t strlen( const char * s ) return rc; } -#warning Test driver missing. +#endif #ifdef TEST -int main() +#include <_PDCLIB_test.h> + +int main( void ) { - return 0; + TESTCASE( strlen( abcde ) == 5 ); + TESTCASE( strlen( "" ) == 0 ); + return TEST_RESULTS; } #endif