|
@@ -38,18 +38,30 @@ void CookieBoxFactoryTest::testLoadDefaultCookie()
|
|
|
Cookie c = cookies[0];
|
|
|
CPPUNIT_ASSERT_EQUAL(string("JSESSIONID"), c.name);
|
|
|
CPPUNIT_ASSERT_EQUAL(string("123456789"), c.value);
|
|
|
+ CPPUNIT_ASSERT_EQUAL((time_t)1181473200, c.expires);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(string("/"), c.path);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(string("localhost"), c.domain);
|
|
|
|
|
|
c = cookies[1];
|
|
|
CPPUNIT_ASSERT_EQUAL(string("user"), c.name);
|
|
|
CPPUNIT_ASSERT_EQUAL(string("me"), c.value);
|
|
|
+ CPPUNIT_ASSERT_EQUAL((time_t)1181473200, c.expires);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(string("/"), c.path);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(string("localhost"), c.domain);
|
|
|
|
|
|
c = cookies[2];
|
|
|
CPPUNIT_ASSERT_EQUAL(string("passwd"), c.name);
|
|
|
CPPUNIT_ASSERT_EQUAL(string("secret"), c.value);
|
|
|
+ CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.expires);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(string("/cgi-bin"), c.path);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(string("localhost"), c.domain);
|
|
|
|
|
|
c = cookies[3];
|
|
|
CPPUNIT_ASSERT_EQUAL(string("novalue"), c.name);
|
|
|
CPPUNIT_ASSERT_EQUAL(string(""), c.value);
|
|
|
+ CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.expires);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(string("/"), c.path);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(string("localhost"), c.domain);
|
|
|
}
|
|
|
|
|
|
void CookieBoxFactoryTest::testCreateNewInstance()
|
|
@@ -60,5 +72,5 @@ void CookieBoxFactoryTest::testCreateNewInstance()
|
|
|
CookieBoxHandle box = factory.createNewInstance();
|
|
|
Cookies cookies = box->criteriaFind("localhost", "/", 0, true);
|
|
|
|
|
|
- CPPUNIT_ASSERT_EQUAL((int32_t)4, (int32_t)cookies.size());
|
|
|
+ CPPUNIT_ASSERT_EQUAL((int32_t)3, (int32_t)cookies.size());
|
|
|
}
|