Fix more of the cookie test following API changes.

This commit is contained in:
Adrien Destugues
2014-06-11 21:59:04 +02:00
parent 6765a83b15
commit 151ef32f45
2 changed files with 10 additions and 10 deletions
+9 -9
View File
@@ -87,7 +87,7 @@ CookieTest::StandardTest()
CPPUNIT_ASSERT(result == B_OK); CPPUNIT_ASSERT(result == B_OK);
url.SetUrlString("http://testsuites.opera.com/cookies/001-1.php"); url.SetUrlString("http://testsuites.opera.com/cookies/001-1.php");
BNetworkCookie* cookie = _GetCookie(jar, url, "001"); const BNetworkCookie* cookie = _GetCookie(jar, url, "001");
CPPUNIT_ASSERT(cookie != NULL); CPPUNIT_ASSERT(cookie != NULL);
@@ -157,7 +157,7 @@ CookieTest::MaxSizeTest()
CPPUNIT_ASSERT(result == B_OK); CPPUNIT_ASSERT(result == B_OK);
url.SetUrlString("http://testsuites.opera.com/cookies/006-1.php"); url.SetUrlString("http://testsuites.opera.com/cookies/006-1.php");
BNetworkCookie* cookie = _GetCookie(jar, url, "006"); const BNetworkCookie* cookie = _GetCookie(jar, url, "006");
CPPUNIT_ASSERT(cookie != NULL); CPPUNIT_ASSERT(cookie != NULL);
CPPUNIT_ASSERT(cookie->Value().Length() == 4096); CPPUNIT_ASSERT(cookie->Value().Length() == 4096);
} }
@@ -183,7 +183,7 @@ CookieTest::MaxNumberTest()
for (int i = 1; i <= 20; i++) for (int i = 1; i <= 20; i++)
{ {
cookieString.SetToFormat("007-%d", i); cookieString.SetToFormat("007-%d", i);
BNetworkCookie* cookie = _GetCookie(jar, url, cookieString.String()); const BNetworkCookie* cookie = _GetCookie(jar, url, cookieString.String());
CPPUNIT_ASSERT(cookie != NULL); CPPUNIT_ASSERT(cookie != NULL);
CPPUNIT_ASSERT(cookie->Value() == "1"); CPPUNIT_ASSERT(cookie->Value() == "1");
} }
@@ -205,7 +205,7 @@ CookieTest::UpdateTest()
CPPUNIT_ASSERT(result == B_OK); CPPUNIT_ASSERT(result == B_OK);
url.SetUrlString("http://testsuites.opera.com/cookies/008-2.php"); url.SetUrlString("http://testsuites.opera.com/cookies/008-2.php");
BNetworkCookie* cookie = _GetCookie(jar, url, "008"); const BNetworkCookie* cookie = _GetCookie(jar, url, "008");
CPPUNIT_ASSERT(cookie != NULL); CPPUNIT_ASSERT(cookie != NULL);
CPPUNIT_ASSERT(cookie->Value() == "2"); CPPUNIT_ASSERT(cookie->Value() == "2");
} }
@@ -222,7 +222,7 @@ CookieTest::HttpOnlyTest()
CPPUNIT_ASSERT(result == B_OK); CPPUNIT_ASSERT(result == B_OK);
url.SetUrlString("http://testsuites.opera.com/cookies/010-1.php"); url.SetUrlString("http://testsuites.opera.com/cookies/010-1.php");
BNetworkCookie* cookie = _GetCookie(jar, url, "010"); const BNetworkCookie* cookie = _GetCookie(jar, url, "010");
CPPUNIT_ASSERT(cookie != NULL); CPPUNIT_ASSERT(cookie != NULL);
CPPUNIT_ASSERT(cookie->Value() == "1"); CPPUNIT_ASSERT(cookie->Value() == "1");
CPPUNIT_ASSERT(cookie->HttpOnly()); CPPUNIT_ASSERT(cookie->HttpOnly());
@@ -241,7 +241,7 @@ CookieTest::EncodingTest()
CPPUNIT_ASSERT(result == B_OK); CPPUNIT_ASSERT(result == B_OK);
url.SetUrlString("http://testsuites.opera.com/cookies/011-1.php"); url.SetUrlString("http://testsuites.opera.com/cookies/011-1.php");
BNetworkCookie* cookie = _GetCookie(jar, url, "011"); const BNetworkCookie* cookie = _GetCookie(jar, url, "011");
CPPUNIT_ASSERT(cookie != NULL); CPPUNIT_ASSERT(cookie != NULL);
CPPUNIT_ASSERT_EQUAL( CPPUNIT_ASSERT_EQUAL(
BString("UTF-8 \303\246\303\270\303\245 \346\227\245\346\234\254"), BString("UTF-8 \303\246\303\270\303\245 \346\227\245\346\234\254"),
@@ -262,7 +262,7 @@ CookieTest::DomainTest()
CPPUNIT_ASSERT(result != B_OK); CPPUNIT_ASSERT(result != B_OK);
url.SetUrlString("http://testsuites.opera.com/cookies/012-1.php"); url.SetUrlString("http://testsuites.opera.com/cookies/012-1.php");
BNetworkCookie* cookie = _GetCookie(jar, url, "012-1"); const BNetworkCookie* cookie = _GetCookie(jar, url, "012-1");
CPPUNIT_ASSERT(cookie != NULL); CPPUNIT_ASSERT(cookie != NULL);
CPPUNIT_ASSERT(cookie->Value() == "1"); CPPUNIT_ASSERT(cookie->Value() == "1");
@@ -297,7 +297,7 @@ CookieTest::PersistantTest()
url.SetUrlString("http://testsuites.opera.com/cookies/013-1.php"); url.SetUrlString("http://testsuites.opera.com/cookies/013-1.php");
BNetworkCookie* cookie = _GetCookie(jar, url, "013-1"); const BNetworkCookie* cookie = _GetCookie(jar, url, "013-1");
CPPUNIT_ASSERT(cookie != NULL); CPPUNIT_ASSERT(cookie != NULL);
CPPUNIT_ASSERT(cookie->Value() == "1"); CPPUNIT_ASSERT(cookie->Value() == "1");
CPPUNIT_ASSERT(cookie->HasExpirationDate()); CPPUNIT_ASSERT(cookie->HasExpirationDate());
@@ -829,7 +829,7 @@ CookieTest::AddTests(BTestSuite& parent)
} }
BNetworkCookie* const BNetworkCookie*
CookieTest::_GetCookie(BNetworkCookieJar& jar, const BUrl& url, CookieTest::_GetCookie(BNetworkCookieJar& jar, const BUrl& url,
const char* name) const char* name)
{ {
+1 -1
View File
@@ -44,7 +44,7 @@ public:
static void AddTests(BTestSuite& suite); static void AddTests(BTestSuite& suite);
private: private:
BNetworkCookie* _GetCookie(BNetworkCookieJar& jar, const BUrl& url, const BNetworkCookie* _GetCookie(BNetworkCookieJar& jar, const BUrl& url,
const char* name); const char* name);
}; };