diff --git a/test_programs/GNUmakefile.68k b/test_programs/GNUmakefile.68k index 00e9922..c3dd3f5 100644 --- a/test_programs/GNUmakefile.68k +++ b/test_programs/GNUmakefile.68k @@ -1,5 +1,5 @@ # -# $Id: GNUmakefile.68k,v 1.2 2004-09-10 07:41:13 obarthel Exp $ +# $Id: GNUmakefile.68k,v 1.3 2004-10-25 19:50:33 obarthel Exp $ # # :ts=8 # @@ -46,10 +46,12 @@ LIBS = -lm -lc -lgcc ############################################################################## -all: test fgets_test iotest sscanf_test printf_test sprintf_test stack_size_test translate_test +all: test fgets_test iotest sscanf_test printf_test sprintf_test stack_size_test \ + translate_test strtok_test clean: - $(DELETE) #?.o #?.map test fgets_test iotest sscanf_test printf_test sprintf_test stack_size_test translate_test + $(DELETE) #?.o #?.map test fgets_test iotest sscanf_test printf_test sprintf_test \ + stack_size_test translate_test strtok_test ############################################################################## @@ -61,6 +63,10 @@ fgets_test : fgets_test.o @echo "Linking $@" $(CC) $(CFLAGS) -o $@ fgets_test.o $(LIBS) -Wl,--cref,-M,-Map=$@.map +strtok_test : strtok_test.o + @echo "Linking $@" + $(CC) $(CFLAGS) -o $@ strtok_test.o $(LIBS) -Wl,--cref,-M,-Map=$@.map + iotest : iotest.o @echo "Linking $@" $(CC) $(CFLAGS) -o $@ iotest.o $(LIBS) -Wl,--cref,-M,-Map=$@.map diff --git a/test_programs/GNUmakefile.os4 b/test_programs/GNUmakefile.os4 index 8dd0d89..3de8d39 100644 --- a/test_programs/GNUmakefile.os4 +++ b/test_programs/GNUmakefile.os4 @@ -1,5 +1,5 @@ # -# $Id: GNUmakefile.os4,v 1.1 2004-09-29 14:37:10 obarthel Exp $ +# $Id: GNUmakefile.os4,v 1.2 2004-10-25 19:50:33 obarthel Exp $ # # :ts=8 # @@ -38,10 +38,12 @@ LIBS = -lm -lc ############################################################################## -all: test fgets_test iotest sscanf_test printf_test sprintf_test stack_size_test translate_test +all: test fgets_test iotest sscanf_test printf_test sprintf_test stack_size_test \ + translate_test strtok_test clean: - $(DELETE) *.o *.map test fgets_test iotest sscanf_test printf_test sprintf_test stack_size_test translate_test + $(DELETE) *.o *.map test fgets_test iotest sscanf_test printf_test sprintf_test \ + stack_size_test translate_test strtok_test ############################################################################## @@ -53,6 +55,10 @@ fgets_test : fgets_test.o @echo "Linking $@" $(CC) $(CFLAGS) -o $@ fgets_test.o $(LIBS) -Wl,--cref,-M,-Map=$@.map +strtok_test : strtok_test.o + @echo "Linking $@" + $(CC) $(CFLAGS) -o $@ strtok_test.o $(LIBS) -Wl,--cref,-M,-Map=$@.map + iotest : iotest.o @echo "Linking $@" $(CC) $(CFLAGS) -o $@ iotest.o $(LIBS) -Wl,--cref,-M,-Map=$@.map diff --git a/test_programs/smakefile b/test_programs/smakefile index c5ea010..46298d2 100644 --- a/test_programs/smakefile +++ b/test_programs/smakefile @@ -1,5 +1,5 @@ # -# $Id: smakefile,v 1.2 2004-09-10 07:41:13 obarthel Exp $ +# $Id: smakefile,v 1.3 2004-10-25 19:50:33 obarthel Exp $ # # :ts=8 # @@ -63,10 +63,10 @@ AFLAGS = \ ############################################################################## -all: setup test fgets_test iotest sscanf_test printf_test sprintf_test stack_size_test translate_test cleanup +all: setup test fgets_test iotest sscanf_test printf_test sprintf_test stack_size_test translate_test strtok_test cleanup clean: - -delete \#?.o \#?.map test fgets_test iotest sscanf_test printf_test sprintf_test stack_size_test translate_test + -delete \#?.o \#?.map test fgets_test iotest sscanf_test printf_test sprintf_test stack_size_test translate_test strtok_test ############################################################################## @@ -90,6 +90,11 @@ fgets_test: fgets_test.o @slink $(LIB)startup.o fgets_test.o to $@ lib $(LIB)c.lib addsym \ map $@.map,fhx fwidth 32 pwidth 32 swidth 32 +strtok_test: strtok_test.o + @echo "Linking $@" + @slink $(LIB)startup.o strtok_test.o to $@ lib $(LIB)c.lib addsym \ + map $@.map,fhx fwidth 32 pwidth 32 swidth 32 + iotest: iotest.o @echo "Linking $@" @slink $(LIB)startup.o iotest.o to $@ lib $(LIB)c.lib addsym \ diff --git a/test_programs/strtok_test.c b/test_programs/strtok_test.c new file mode 100644 index 0000000..e684a34 --- /dev/null +++ b/test_programs/strtok_test.c @@ -0,0 +1,35 @@ +/* + * $Id: strtok_test.c,v 1.1 2004-10-25 19:50:33 obarthel Exp $ + * + * :ts=4 + */ + +/****************************************************************************/ + +#include +#include + +/****************************************************************************/ + +int +main(int argc,char ** argv) +{ + char test[256]; + char * one; + char * two; + char * three; + + strcpy(test," one two three"); + + strtok(test," "); + + one = strtok(NULL," "); + two = strtok(NULL," "); + three = strtok(NULL," "); + + printf("one = %p '%s'\n",one,one); + printf("two = %p '%s'\n",two,two); + printf("three = %p '%s'\n",three,three); + + return(0); +}