|
@@ -125,7 +125,7 @@ void CookieStorageTest::testCriteriaFind()
|
|
|
std::deque<Cookie> aria2SlashFoo = st.criteriaFind("www.aria2.org", "/foo",
|
|
|
0, false);
|
|
|
CPPUNIT_ASSERT_EQUAL((size_t)3, aria2SlashFoo.size());
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("bravo"), aria2SlashFoo[0].name);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("bravo"), aria2SlashFoo[0].getName());
|
|
|
CPPUNIT_ASSERT(std::find(aria2SlashFoo.begin(), aria2SlashFoo.end(), alpha)
|
|
|
!= aria2SlashFoo.end());
|
|
|
CPPUNIT_ASSERT(std::find(aria2SlashFoo.begin(), aria2SlashFoo.end(), echo)
|
|
@@ -142,12 +142,12 @@ void CookieStorageTest::testCriteriaFind()
|
|
|
|
|
|
std::deque<Cookie> dlAria2 = st.criteriaFind("dl.aria2.org", "/", 0, false);
|
|
|
CPPUNIT_ASSERT_EQUAL((size_t)1, dlAria2.size());
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("alpha"), dlAria2[0].name);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("alpha"), dlAria2[0].getName());
|
|
|
|
|
|
std::deque<Cookie> numericHostCookies = st.criteriaFind("192.168.1.1", "/", 0,
|
|
|
false);
|
|
|
CPPUNIT_ASSERT_EQUAL((size_t)1, numericHostCookies.size());
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("golf"), numericHostCookies[0].name);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("golf"), numericHostCookies[0].getName());
|
|
|
}
|
|
|
|
|
|
void CookieStorageTest::testLoad()
|
|
@@ -159,36 +159,36 @@ void CookieStorageTest::testLoad()
|
|
|
CPPUNIT_ASSERT_EQUAL((size_t)4, st.size());
|
|
|
|
|
|
Cookie c = *st.begin();
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("JSESSIONID"), c.name);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("123456789"), c.value);
|
|
|
- CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.expires);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("/"), c.path);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("localhost"), c.domain);
|
|
|
- CPPUNIT_ASSERT(c.secure);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("JSESSIONID"), c.getName());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("123456789"), c.getValue());
|
|
|
+ CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.getExpiry());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("/"), c.getPath());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("localhost"), c.getDomain());
|
|
|
+ CPPUNIT_ASSERT(c.isSecureCookie());
|
|
|
|
|
|
c = *(st.begin()+1);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("passwd"), c.name);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("secret"), c.value);
|
|
|
- CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.expires);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("/cgi-bin"), c.path);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("localhost"), c.domain);
|
|
|
- CPPUNIT_ASSERT(!c.secure);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("passwd"), c.getName());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("secret"), c.getValue());
|
|
|
+ CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.getExpiry());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("/cgi-bin"), c.getPath());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("localhost"), c.getDomain());
|
|
|
+ CPPUNIT_ASSERT(!c.isSecureCookie());
|
|
|
|
|
|
c = *(st.begin()+2);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("TAX"), c.name);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("1000"), c.value);
|
|
|
- CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.expires);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("/"), c.path);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("overflow"), c.domain);
|
|
|
- CPPUNIT_ASSERT(!c.secure);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("TAX"), c.getName());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("1000"), c.getValue());
|
|
|
+ CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.getExpiry());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("/"), c.getPath());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("overflow"), c.getDomain());
|
|
|
+ CPPUNIT_ASSERT(!c.isSecureCookie());
|
|
|
|
|
|
c = *(st.begin()+3);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("novalue"), c.name);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string(""), c.value);
|
|
|
- CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.expires);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("/"), c.path);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("localhost"), c.domain);
|
|
|
- CPPUNIT_ASSERT(!c.secure);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("novalue"), c.getName());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string(""), c.getValue());
|
|
|
+ CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.getExpiry());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("/"), c.getPath());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("localhost"), c.getDomain());
|
|
|
+ CPPUNIT_ASSERT(!c.isSecureCookie());
|
|
|
}
|
|
|
|
|
|
void CookieStorageTest::testLoad_sqlite3()
|
|
@@ -198,20 +198,20 @@ void CookieStorageTest::testLoad_sqlite3()
|
|
|
st.load("cookies.sqlite");
|
|
|
CPPUNIT_ASSERT_EQUAL((size_t)2, st.size());
|
|
|
Cookie c = *st.begin();
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("JSESSIONID"), c.name);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("123456789"), c.value);
|
|
|
- CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.expires);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("/"), c.path);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("localhost"), c.domain);
|
|
|
- CPPUNIT_ASSERT(c.secure);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("JSESSIONID"), c.getName());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("123456789"), c.getValue());
|
|
|
+ CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.getExpiry());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("/"), c.getPath());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("localhost"), c.getDomain());
|
|
|
+ CPPUNIT_ASSERT(c.isSecureCookie());
|
|
|
|
|
|
c = *(st.begin()+1);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("foo"), c.name);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("bar"), c.value);
|
|
|
- CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.expires);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("/path/to"), c.path);
|
|
|
- CPPUNIT_ASSERT_EQUAL(std::string("overflow_time_t"), c.domain);
|
|
|
- CPPUNIT_ASSERT(!c.secure);
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("foo"), c.getName());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("bar"), c.getValue());
|
|
|
+ CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.getExpiry());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("/path/to"), c.getPath());
|
|
|
+ CPPUNIT_ASSERT_EQUAL(std::string("overflow_time_t"), c.getDomain());
|
|
|
+ CPPUNIT_ASSERT(!c.isSecureCookie());
|
|
|
|
|
|
#else // !HAVE_SQLITE3
|
|
|
try {
|