mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-22 07:01:12 +01:00
cookie age test fix
This commit is contained in:
parent
364536c5fd
commit
376b46f60e
@ -113,6 +113,7 @@ void HTTPCookieTest::testUnescape()
|
|||||||
assert (unescaped == "\n\t@,;\"'");
|
assert (unescaped == "\n\t@,;\"'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HTTPCookieTest::testExpiryFuture()
|
void HTTPCookieTest::testExpiryFuture()
|
||||||
{
|
{
|
||||||
DateTime future;
|
DateTime future;
|
||||||
@ -128,6 +129,7 @@ void HTTPCookieTest::testExpiryFuture()
|
|||||||
testCookieExpiry(future);
|
testCookieExpiry(future);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HTTPCookieTest::testExpiryPast()
|
void HTTPCookieTest::testExpiryPast()
|
||||||
{
|
{
|
||||||
DateTime past;
|
DateTime past;
|
||||||
@ -143,7 +145,9 @@ void HTTPCookieTest::testExpiryPast()
|
|||||||
testCookieExpiry(past);
|
testCookieExpiry(past);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTTPCookieTest::testCookieExpiry(DateTime expiryTime){
|
|
||||||
|
void HTTPCookieTest::testCookieExpiry(DateTime expiryTime)
|
||||||
|
{
|
||||||
NameValueCollection nvc;
|
NameValueCollection nvc;
|
||||||
nvc.add("name", "value");
|
nvc.add("name", "value");
|
||||||
std::string expiryString = DateTimeFormatter::format(expiryTime.timestamp(),DateTimeFormat::HTTP_FORMAT);
|
std::string expiryString = DateTimeFormatter::format(expiryTime.timestamp(),DateTimeFormat::HTTP_FORMAT);
|
||||||
@ -181,7 +185,7 @@ void HTTPCookieTest::testCookieExpiry(DateTime expiryTime){
|
|||||||
//assert that the cookie's max age is the number of seconds between
|
//assert that the cookie's max age is the number of seconds between
|
||||||
//the creation of the cookie and the expiry time passed to its
|
//the creation of the cookie and the expiry time passed to its
|
||||||
//constuctor, within a delta of the lifetime of the cookie
|
//constuctor, within a delta of the lifetime of the cookie
|
||||||
assert (abs(cookieMaxAge - expectedMaxAge) <= delta.seconds());
|
assert (cookieMaxAge - expectedMaxAge <= delta.seconds());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user