diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/test/llhttpdate_tut.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/test/llhttpdate_tut.cpp')
-rw-r--r-- | linden/indra/test/llhttpdate_tut.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/linden/indra/test/llhttpdate_tut.cpp b/linden/indra/test/llhttpdate_tut.cpp index a07b11f..8e096cb 100644 --- a/linden/indra/test/llhttpdate_tut.cpp +++ b/linden/indra/test/llhttpdate_tut.cpp | |||
@@ -69,24 +69,25 @@ namespace tut | |||
69 | time_t sometime; | 69 | time_t sometime; |
70 | time(&sometime); | 70 | time(&sometime); |
71 | some_date = LLDate((F64) sometime); | 71 | some_date = LLDate((F64) sometime); |
72 | struct tm result; | 72 | struct tm *result; |
73 | char expected[255], *actual; | 73 | char expected[255]; |
74 | std::string actual; | ||
74 | 75 | ||
75 | gmtime_r((time_t *)&sometime, &result); | 76 | result = gmtime(&sometime); |
76 | /* | 77 | /* |
77 | std::cout << " seconds: "<< result.tm_sec | 78 | std::cout << " seconds: "<< result->tm_sec |
78 | << ", minutes: " << result.tm_min | 79 | << ", minutes: " << result->tm_min |
79 | << ", hours: " << result.tm_hour | 80 | << ", hours: " << result->tm_hour |
80 | << ", day of the month: " << result.tm_mday | 81 | << ", day of the month: " << result->tm_mday |
81 | << ", month: " << result.tm_mon | 82 | << ", month: " << result->tm_mon |
82 | << ", year: " << result.tm_year | 83 | << ", year: " << result->tm_year |
83 | << ", day of the week: " << result.tm_wday | 84 | << ", day of the week: " << result->tm_wday |
84 | << ", day in the year: " << result.tm_yday | 85 | << ", day in the year: " << result->tm_yday |
85 | << ", DST: " << result.tm_isdst << std::endl; | 86 | << ", DST: " << result->tm_isdst << std::endl; |
86 | */ | 87 | */ |
87 | strftime(expected, 255, "%A, %d %h %Y %H:%M:%S GMT", &result); | 88 | strftime(expected, 255, "%A, %d %b %Y %H:%M:%S GMT", result); |
88 | actual = (char *) some_date.asRFC1123().c_str(); | 89 | actual = some_date.asRFC1123(); |
89 | // probably not a good idea to use strcmp but this is just a unit test | 90 | // probably not a good idea to use strcmp but this is just a unit test |
90 | ensure("Current time in RFC 1123", (strcmp(expected, actual) == 0)); | 91 | ensure("Current time in RFC 1123", (strcmp(expected, actual.c_str()) == 0)); |
91 | } | 92 | } |
92 | } | 93 | } |