projects
/
fw
/
pdclib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added test drivers.
[fw/pdclib]
/
functions
/
string
/
strspn.c
diff --git
a/functions/string/strspn.c
b/functions/string/strspn.c
index b8e703d1f09411a7e4d82678009cdfd3f5417e28..a5859cc2ca89b7b2d544457370fde2a74b6c550a 100644
(file)
--- a/
functions/string/strspn.c
+++ b/
functions/string/strspn.c
@@
-34,11
+34,15
@@
size_t strspn( const char * s1, const char * s2 )
return len;
}
return len;
}
-#warning Test driver missing.
-
#ifdef TEST
#ifdef TEST
+#include <_PDCLIB_test.h>
+
int main()
{
int main()
{
- return 0;
+ BEGIN_TESTS;
+ TESTCASE( strspn( abcde, "abc" ) == 3 );
+ TESTCASE( strspn( abcde, "b" ) == 0 );
+ TESTCASE( strspn( abcde, abcde ) == 5 );
+ return TEST_RESULTS;
}
#endif
}
#endif