From: solar Date: Fri, 14 May 2010 03:55:01 +0000 (+0000) Subject: Bug #36, covered by testdriver but not yet fixed. X-Git-Url: https://git.gag.com/?p=fw%2Fpdclib;a=commitdiff_plain;h=63d49e9f374cdcedd3938eabe849021bcde234fc Bug #36, covered by testdriver but not yet fixed. git-svn-id: https://srv7.svn-repos.de/dev34/pdclib/trunk@404 546481bc-9713-0410-bf18-d3337bbf4a3e --- diff --git a/functions/string/strtok.c b/functions/string/strtok.c index c586b97..691c640 100644 --- a/functions/string/strtok.c +++ b/functions/string/strtok.c @@ -91,6 +91,16 @@ int main( void ) TESTCASE( s[7] == 'd' ); TESTCASE( s[8] == '\0' ); TESTCASE( strtok( NULL, "_" ) == NULL ); + strcpy( s, "ab_cd" ); + TESTCASE( strtok( s, "_" ) == &s[0] ); + TESTCASE( s[0] == 'a' ); + TESTCASE( s[1] == 'b' ); + TESTCASE( s[2] == '\0' ); + TESTCASE( strtok( NULL, "_" ) == &s[3] ); + TESTCASE( s[3] == 'c' ); + TESTCASE( s[4] == 'd' ); + TESTCASE( s[5] == '\0' ); + TESTCASE( strtok( NULL, "_" ) == NULL ); return TEST_RESULTS; } #endif