From: solar Date: Sun, 20 Nov 2005 17:25:25 +0000 (+0000) Subject: Added test driver. X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=e47c05e8ae9d7baacf998fb073ee36401cee7672;p=fw%2Fpdclib Added test driver. git-svn-id: https://srv7.svn-repos.de/dev34/pdclib/trunk@69 546481bc-9713-0410-bf18-d3337bbf4a3e --- diff --git a/functions/string/memset.c b/functions/string/memset.c index 9318c85..735a8e6 100644 --- a/functions/string/memset.c +++ b/functions/string/memset.c @@ -20,11 +20,20 @@ void * memset( void * s, int c, size_t n ) return s; } -#warning Test driver missing. - #ifdef TEST +#include <_PDCLIB_test.h> + int main() { - return 0; + char s[10] = "xxxxxxxxx"; + BEGIN_TESTS; + TESTCASE( memset( s, 'o', 10 ) == s ); + TESTCASE( s[9] == 'o' ); + TESTCASE( memset( s, '_', 0 ) == s ); + TESTCASE( s[0] == 'o' ); + TESTCASE( memset( s, '_', 1 ) == s ); + TESTCASE( s[0] == '_' ); + TESTCASE( s[1] == 'o' ); + return TEST_RESULTS; } #endif