1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- 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
This commit is contained in:
Olaf Barthel
2005-08-26 12:21:51 +00:00
parent eb10d40332
commit 5acfef419b
5 changed files with 46 additions and 11 deletions

View File

@ -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:

View File

@ -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

22
test_programs/date_test.c Executable file
View File

@ -0,0 +1,22 @@
#include <time.h>
#include <stdio.h>
#include <locale.h>
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;
}

View File

@ -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 \

View File

@ -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");
}