]> pd.if.org Git - pdclib/blobdiff - functions/string/strlen.c
Added #ifdef to allow regression against system lib.
[pdclib] / functions / string / strlen.c
index c862805ed74840f0e5b906e3cf2008beb1beef43..17ab3cfd948b4331b43904a9f8f959b6db011347 100644 (file)
@@ -10,6 +10,8 @@
 
 #include <string.h>
 
+#ifndef REGTEST
+
 size_t strlen( const char * s )
 {
     size_t rc = 0;
@@ -20,4 +22,16 @@ size_t strlen( const char * s )
     return rc;
 }
 
-#warning Test driver missing.
+#endif
+
+#ifdef TEST
+#include <_PDCLIB_test.h>
+
+int main()
+{
+    BEGIN_TESTS;
+    TESTCASE( strlen( abcde ) == 5 );
+    TESTCASE( strlen( "" ) == 0 );
+    return TEST_RESULTS;
+}
+#endif