mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
added test case 517: 22 tests of the curl_getdate() function
This commit is contained in:
parent
86f059dcfb
commit
66f6f43056
@ -27,7 +27,8 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
|
||||
test172 test204 test205 test173 test174 test175 test176 test177 \
|
||||
test513 test514 test178 test179 test180 test181 test182 test183 \
|
||||
test184 test185 test186 test187 test188 test189 test191 test192 \
|
||||
test193 test194 test195 test196 test197 test198 test515 test516
|
||||
test193 test194 test195 test196 test197 test198 test515 test516 \
|
||||
test517
|
||||
|
||||
# The following tests have been removed from the dist since they no longer
|
||||
# work. We need to fix the test suite's FTPS server first, then bring them
|
||||
|
52
tests/data/test517
Normal file
52
tests/data/test517
Normal file
@ -0,0 +1,52 @@
|
||||
#
|
||||
# Server-side
|
||||
<reply>
|
||||
</reply>
|
||||
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
none
|
||||
</server>
|
||||
# tool is what to use instead of 'curl'
|
||||
<tool>
|
||||
lib517
|
||||
</tool>
|
||||
|
||||
<name>
|
||||
curl_getdate() testing
|
||||
</name>
|
||||
<command>
|
||||
nothing
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<stdout>
|
||||
0: Sun, 06 Nov 1994 08:49:37 GMT => 784111777
|
||||
1: Sunday, 06-Nov-94 08:49:37 GMT => 784111777
|
||||
2: Sun Nov 6 08:49:37 1994 => 784111777
|
||||
3: 06 Nov 1994 08:49:37 GMT => 784111777
|
||||
4: 06-Nov-94 08:49:37 GMT => 784111777
|
||||
5: Nov 6 08:49:37 1994 => 784111777
|
||||
6: 06 Nov 1994 08:49:37 => 784111777
|
||||
7: 06-Nov-94 08:49:37 => 784111777
|
||||
8: 1994 Nov 6 08:49:37 => 784111777
|
||||
9: GMT 08:49:37 06-Nov-94 Sunday => 784111777
|
||||
10: 94 6 Nov 08:49:37 => 784111777
|
||||
11: 1994 Nov 6 => 784080000
|
||||
12: 06-Nov-94 => 784080000
|
||||
13: Sun Nov 6 94 => 784080000
|
||||
14: 1994.Nov.6 => 784080000
|
||||
15: Sun/Nov/6/94/GMT => 784080000
|
||||
16: Sun, 06 Nov 1994 08:49:37 CET => 784108177
|
||||
17: 06 Nov 1994 08:49:37 EST => 784129777
|
||||
18: Sun, 12 Sep 2004 15:05:58 -0700 => 1095026758
|
||||
19: Sat, 11 Sep 2004 21:32:11 +0200 => 1094931131
|
||||
20: 20040912 15:05:58 -0700 => 1095026758
|
||||
21: 20040911 +0200 => 1094853600
|
||||
22: 2094 Nov 6 => 2147483647
|
||||
</stdout>
|
||||
</verify>
|
@ -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
|
||||
|
41
tests/libtest/lib517.c
Normal file
41
tests/libtest/lib517.c
Normal file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user