diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-11-15 21:49:35 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-11-15 21:49:35 +0000 |
commit | 66f6f430567526305c6fcc8c4ec2ae19f4a84e08 (patch) | |
tree | 56db71876b64f85c56aeb425240b48d0734bfd07 /tests/libtest | |
parent | 86f059dcfbb32ee7ee25c7232457c558ea9f8c4f (diff) |
added test case 517: 22 tests of the curl_getdate() function
Diffstat (limited to 'tests/libtest')
-rw-r--r-- | tests/libtest/Makefile.am | 6 | ||||
-rw-r--r-- | tests/libtest/lib517.c | 41 |
2 files changed, 46 insertions, 1 deletions
diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am index 06fbe5519..923652065 100644 --- a/tests/libtest/Makefile.am +++ b/tests/libtest/Makefile.am @@ -39,7 +39,7 @@ SUPPORTFILES = first.c test.h # These are all libcurl test programs noinst_PROGRAMS = lib500 lib501 lib502 lib503 lib504 lib505 lib506 lib507 \ - lib508 lib509 lib510 lib511 lib512 lib513 lib514 lib515 lib516 + lib508 lib509 lib510 lib511 lib512 lib513 lib514 lib515 lib516 lib517 lib500_SOURCES = lib500.c $(SUPPORTFILES) lib500_LDADD = $(LIBDIR)/libcurl.la @@ -108,3 +108,7 @@ lib515_DEPENDENCIES = $(LIBDIR)/libcurl.la lib516_SOURCES = lib516.c $(SUPPORTFILES) lib516_LDADD = $(LIBDIR)/libcurl.la lib516_DEPENDENCIES = $(LIBDIR)/libcurl.la + +lib517_SOURCES = lib517.c $(SUPPORTFILES) +lib517_LDADD = $(LIBDIR)/libcurl.la +lib517_DEPENDENCIES = $(LIBDIR)/libcurl.la diff --git a/tests/libtest/lib517.c b/tests/libtest/lib517.c new file mode 100644 index 000000000..ea296914f --- /dev/null +++ b/tests/libtest/lib517.c @@ -0,0 +1,41 @@ +#include "test.h" + +const char *dates[]={ + "Sun, 06 Nov 1994 08:49:37 GMT", + "Sunday, 06-Nov-94 08:49:37 GMT", + "Sun Nov 6 08:49:37 1994", + "06 Nov 1994 08:49:37 GMT", + "06-Nov-94 08:49:37 GMT", + "Nov 6 08:49:37 1994", + "06 Nov 1994 08:49:37", + "06-Nov-94 08:49:37", + "1994 Nov 6 08:49:37", + "GMT 08:49:37 06-Nov-94 Sunday", + "94 6 Nov 08:49:37", + "1994 Nov 6", + "06-Nov-94", + "Sun Nov 6 94", + "1994.Nov.6", + "Sun/Nov/6/94/GMT", + "Sun, 06 Nov 1994 08:49:37 CET", + "06 Nov 1994 08:49:37 EST", + "Sun, 12 Sep 2004 15:05:58 -0700", + "Sat, 11 Sep 2004 21:32:11 +0200", + "20040912 15:05:58 -0700", + "20040911 +0200", + "2094 Nov 6", + NULL +}; + +int test(char *URL) +{ + int i; + + (void)URL; /* not used */ + + for(i=0; dates[i]; i++) { + printf("%d: %s => %ld\n", i, dates[i], (long)curl_getdate(dates[i], NULL)); + } + + return 0; +} |