summaryrefslogtreecommitdiff
path: root/indra/test/llhttpdate_tut.cpp
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@lindenlab.com>2008-06-02 21:14:31 +0000
committerBryan O'Sullivan <bos@lindenlab.com>2008-06-02 21:14:31 +0000
commit9db949eec327df4173fde3de934a87bedb0db13c (patch)
treeaeffa0f0e68b1d2ceb74d460cbbd22652c9cd159 /indra/test/llhttpdate_tut.cpp
parent419e13d0acaabf5e1e02e9b64a07648bce822b2f (diff)
svn merge -r88066:88786 svn+ssh://svn.lindenlab.com/svn/linden/branches/cmake-9-merge
dataserver-is-deprecated for-fucks-sake-whats-with-these-commit-markers
Diffstat (limited to 'indra/test/llhttpdate_tut.cpp')
-rw-r--r--indra/test/llhttpdate_tut.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/indra/test/llhttpdate_tut.cpp b/indra/test/llhttpdate_tut.cpp
index 1be98250d2..c630e9caf0 100644
--- a/indra/test/llhttpdate_tut.cpp
+++ b/indra/test/llhttpdate_tut.cpp
@@ -69,24 +69,25 @@ namespace tut
time_t sometime;
time(&sometime);
some_date = LLDate((F64) sometime);
- struct tm result;
- char expected[255], *actual;
+ struct tm *result;
+ char expected[255];
+ std::string actual;
- gmtime_r((time_t *)&sometime, &result);
+ result = gmtime(&sometime);
/*
- std::cout << " seconds: "<< result.tm_sec
- << ", minutes: " << result.tm_min
- << ", hours: " << result.tm_hour
- << ", day of the month: " << result.tm_mday
- << ", month: " << result.tm_mon
- << ", year: " << result.tm_year
- << ", day of the week: " << result.tm_wday
- << ", day in the year: " << result.tm_yday
- << ", DST: " << result.tm_isdst << std::endl;
+ std::cout << " seconds: "<< result->tm_sec
+ << ", minutes: " << result->tm_min
+ << ", hours: " << result->tm_hour
+ << ", day of the month: " << result->tm_mday
+ << ", month: " << result->tm_mon
+ << ", year: " << result->tm_year
+ << ", day of the week: " << result->tm_wday
+ << ", day in the year: " << result->tm_yday
+ << ", DST: " << result->tm_isdst << std::endl;
*/
- strftime(expected, 255, "%A, %d %h %Y %H:%M:%S GMT", &result);
- actual = (char *) some_date.asRFC1123().c_str();
+ strftime(expected, 255, "%A, %d %b %Y %H:%M:%S GMT", result);
+ actual = some_date.asRFC1123();
// probably not a good idea to use strcmp but this is just a unit test
- ensure("Current time in RFC 1123", (strcmp(expected, actual) == 0));
+ ensure("Current time in RFC 1123", (strcmp(expected, actual.c_str()) == 0));
}
}