From 5acfef419bee48746a369283b914643ace81f438 Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Fri, 26 Aug 2005 12:21:51 +0000 Subject: [PATCH] - Added the "date_test" program. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15019 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- test_programs/GNUmakefile.68k | 10 +++++++--- test_programs/GNUmakefile.os4 | 10 +++++++--- test_programs/date_test.c | 22 ++++++++++++++++++++++ test_programs/smakefile | 11 ++++++++--- test_programs/test.c | 4 ++-- 5 files changed, 46 insertions(+), 11 deletions(-) create mode 100755 test_programs/date_test.c diff --git a/test_programs/GNUmakefile.68k b/test_programs/GNUmakefile.68k index 49eaadf..b91ece1 100644 --- a/test_programs/GNUmakefile.68k +++ b/test_programs/GNUmakefile.68k @@ -1,5 +1,5 @@ # -# $Id: GNUmakefile.68k,v 1.7 2005-05-17 19:15:31 obarthel Exp $ +# $Id: GNUmakefile.68k,v 1.8 2005-08-26 12:21:51 obarthel Exp $ # # :ts=8 # @@ -48,12 +48,12 @@ LIBS = -lm -lc -lgcc all: test fgets_test iotest sscanf_test printf_test sprintf_test \ stack_size_test translate_test strtok_test uname simple \ - fstat_stdout_test simple_sprintf + fstat_stdout_test simple_sprintf date_test clean: $(DELETE) #?.o #?.map test fgets_test iotest sscanf_test printf_test \ sprintf_test stack_size_test translate_test strtok_test uname \ - simple fstat_stdout_test simple_sprintf + simple fstat_stdout_test simple_sprintf date_test ############################################################################## @@ -109,6 +109,10 @@ simple_sprintf : simple_sprintf.o @echo "Linking $@" $(CC) -nostdlib $(CFLAGS) -o $@ simple_sprintf.o -lc -Wl,--cref,-M,-Map=$@.map +date_test : date_test.o + @echo "Linking $@" + $(CC) $(CFLAGS) -o $@ date_test.o $(LIBS) -Wl,--cref,-M,-Map=$@.map + ############################################################################## mkid: diff --git a/test_programs/GNUmakefile.os4 b/test_programs/GNUmakefile.os4 index 1502340..a4404c3 100644 --- a/test_programs/GNUmakefile.os4 +++ b/test_programs/GNUmakefile.os4 @@ -1,5 +1,5 @@ # -# $Id: GNUmakefile.os4,v 1.8 2005-05-18 07:22:51 obarthel Exp $ +# $Id: GNUmakefile.os4,v 1.9 2005-08-26 12:21:51 obarthel Exp $ # # :ts=8 # @@ -40,12 +40,12 @@ LIBS = -lm -lc -ldebug -lgcc all: test fgets_test iotest sscanf_test printf_test sprintf_test \ stack_size_test translate_test strtok_test uname simple \ - fstat_stdout_test simple_sprintf + fstat_stdout_test simple_sprintf date_test clean: $(DELETE) *.o *.map test fgets_test iotest sscanf_test printf_test \ sprintf_test stack_size_test translate_test strtok_test \ - uname simple fstat_stdout_test simple_sprintf + uname simple fstat_stdout_test simple_sprintf date_test ############################################################################## @@ -53,6 +53,10 @@ test : test.o @echo "Linking $@" $(CC) $(CFLAGS) -o $@ test.o $(LIBS) -Wl,--cref,-M,-Map=$@.map +date_test : date_test.o + @echo "Linking $@" + $(CC) $(CFLAGS) -o $@ test.o $(LIBS) -Wl,--cref,-M,-Map=$@.map + fgets_test : fgets_test.o @echo "Linking $@" $(CC) $(CFLAGS) -o $@ fgets_test.o $(LIBS) -Wl,--cref,-M,-Map=$@.map diff --git a/test_programs/date_test.c b/test_programs/date_test.c new file mode 100755 index 0000000..a538daf --- /dev/null +++ b/test_programs/date_test.c @@ -0,0 +1,22 @@ +#include +#include +#include + +int +main(void) +{ + time_t tm; + struct tm *ptr; + char str[60]; + + setlocale(LC_ALL, "C"); + + tm = time(NULL); + ptr = localtime(&tm); + + strftime(str, sizeof(str), "%x\n", ptr); + + printf(str); + + return 0; +} diff --git a/test_programs/smakefile b/test_programs/smakefile index ca3e6d8..06a7cf0 100644 --- a/test_programs/smakefile +++ b/test_programs/smakefile @@ -1,5 +1,5 @@ # -# $Id: smakefile,v 1.7 2005-05-17 19:15:32 obarthel Exp $ +# $Id: smakefile,v 1.8 2005-08-26 12:21:51 obarthel Exp $ # # :ts=8 # @@ -67,14 +67,14 @@ all: \ setup \ test fgets_test iotest sscanf_test printf_test sprintf_test \ stack_size_test translate_test strtok_test uname simple \ - fstat_stdout_test simple_sprintf \ + fstat_stdout_test simple_sprintf date_test \ cleanup clean: -delete \#?.o \#?.map \ test fgets_test iotest sscanf_test printf_test sprintf_test \ stack_size_test translate_test strtok_test uname simple \ - simple_sprintf + simple_sprintf date_test ############################################################################## @@ -93,6 +93,11 @@ test: test.o @slink $(LIB)startup.o test.o to $@ lib $(LIB)c.lib addsym \ map $@.map,fhx fwidth 32 pwidth 32 swidth 32 +date_test: date_test.o + @echo "Linking $@" + @slink $(LIB)startup.o date_test.o to $@ lib $(LIB)c.lib addsym \ + map $@.map,fhx fwidth 32 pwidth 32 swidth 32 + fgets_test: fgets_test.o @echo "Linking $@" @slink $(LIB)startup.o fgets_test.o to $@ lib $(LIB)c.lib addsym \ diff --git a/test_programs/test.c b/test_programs/test.c index 0a62c5f..82d6a6b 100644 --- a/test_programs/test.c +++ b/test_programs/test.c @@ -1,5 +1,5 @@ /* - * $Id: test.c,v 1.5 2005-05-18 07:22:52 obarthel Exp $ + * $Id: test.c,v 1.6 2005-08-26 12:21:51 obarthel Exp $ * * :ts=4 */ @@ -52,7 +52,7 @@ destructor_test2(void) void __attribute__ ((destructor)) destructor_test3(void) { - DebugPrintF("__iob = 0x%08lx\n",__iob); + /*DebugPrintF("__iob = 0x%08lx\n",__iob);*/ fprintf(stderr,"destructor #3 called\n"); }