tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
--- a/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp	Tue Jan 26 12:42:25 2010 +0200
+++ b/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp	Tue Feb 02 00:43:10 2010 +0200
@@ -234,7 +234,7 @@
     QTest::newRow("path-with-utf8-2") << "a=b;path=/R%C3%A9sum%C3%A9" << cookie;
 
     cookie.setPath(QString());
-    cookie.setDomain(".qt.nokia.com");
+    cookie.setDomain("qt.nokia.com");
     QTest::newRow("plain-domain1") << "a=b;domain=qt.nokia.com" << cookie;
     QTest::newRow("plain-domain2") << "a=b; domain=qt.nokia.com " << cookie;
     QTest::newRow("plain-domain3") << "a=b;domain=QT.NOKIA.COM" << cookie;
@@ -247,32 +247,25 @@
     QTest::newRow("dot-domain4") << "a=b; Domain = .QT.NOKIA.COM" << cookie;
 
     cookie.setDomain(QString::fromUtf8(".d\303\270gn\303\245pent.troll.no"));
-    QTest::newRow("idn-domain1") << "a=b;domain=xn--dgnpent-gxa2o.troll.no" << cookie;
-    QTest::newRow("idn-domain2") << "a=b;domain=d\303\270gn\303\245pent.troll.no" << cookie;
-    QTest::newRow("idn-domain3") << "a=b;domain=XN--DGNPENT-GXA2O.TROLL.NO" << cookie;
-    QTest::newRow("idn-domain4") << "a=b;domain=D\303\230GN\303\205PENT.troll.NO" << cookie;
-    QTest::newRow("idn-domain5") << "a=b;domain = D\303\230GN\303\205PENT.troll.NO" << cookie;
-
-    cookie.setDomain(QString::fromUtf8(".d\303\270gn\303\245pent.troll.no"));
-    QTest::newRow("dot-idn-domain1") << "a=b;domain=.xn--dgnpent-gxa2o.troll.no" << cookie;
-    QTest::newRow("dot-idn-domain2") << "a=b;domain=.d\303\270gn\303\245pent.troll.no" << cookie;
-    QTest::newRow("dot-idn-domain3") << "a=b;domain=.XN--DGNPENT-GXA2O.TROLL.NO" << cookie;
-    QTest::newRow("dot-idn-domain4") << "a=b;domain=.D\303\230GN\303\205PENT.troll.NO" << cookie;
+    QTest::newRow("idn-domain1") << "a=b;domain=.xn--dgnpent-gxa2o.troll.no" << cookie;
+    QTest::newRow("idn-domain2") << "a=b;domain=.d\303\270gn\303\245pent.troll.no" << cookie;
+    QTest::newRow("idn-domain3") << "a=b;domain=.XN--DGNPENT-GXA2O.TROLL.NO" << cookie;
+    QTest::newRow("idn-domain4") << "a=b;domain=.D\303\230GN\303\205PENT.troll.NO" << cookie;
 
     cookie.setDomain(".qt.nokia.com");
     cookie.setPath("/");
-    QTest::newRow("two-fields") << "a=b;domain=qt.nokia.com;path=/" << cookie;
-    QTest::newRow("two-fields2") << "a=b; domain=qt.nokia.com; path=/" << cookie;
-    QTest::newRow("two-fields3") << "a=b;   domain=qt.nokia.com ; path=/ " << cookie;
-    QTest::newRow("two-fields4") << "a=b;path=/; domain=qt.nokia.com" << cookie;
-    QTest::newRow("two-fields5") << "a=b; path=/  ;   domain=qt.nokia.com" << cookie;
-    QTest::newRow("two-fields6") << "a=b; path= /  ;   domain =qt.nokia.com" << cookie;
+    QTest::newRow("two-fields") << "a=b;domain=.qt.nokia.com;path=/" << cookie;
+    QTest::newRow("two-fields2") << "a=b; domain=.qt.nokia.com; path=/" << cookie;
+    QTest::newRow("two-fields3") << "a=b;   domain=.qt.nokia.com ; path=/ " << cookie;
+    QTest::newRow("two-fields4") << "a=b;path=/; domain=.qt.nokia.com" << cookie;
+    QTest::newRow("two-fields5") << "a=b; path=/  ;   domain=.qt.nokia.com" << cookie;
+    QTest::newRow("two-fields6") << "a=b; path= /  ;   domain =.qt.nokia.com" << cookie;
 
     cookie.setSecure(true);
-    QTest::newRow("three-fields") << "a=b;domain=qt.nokia.com;path=/;secure" << cookie;
-    QTest::newRow("three-fields2") << "a=b;secure;path=/;domain=qt.nokia.com" << cookie;
-    QTest::newRow("three-fields3") << "a=b;secure;domain=qt.nokia.com; path=/" << cookie;
-    QTest::newRow("three-fields4") << "a = b;secure;domain=qt.nokia.com; path=/" << cookie;
+    QTest::newRow("three-fields") << "a=b;domain=.qt.nokia.com;path=/;secure" << cookie;
+    QTest::newRow("three-fields2") << "a=b;secure;path=/;domain=.qt.nokia.com" << cookie;
+    QTest::newRow("three-fields3") << "a=b;secure;domain=.qt.nokia.com; path=/" << cookie;
+    QTest::newRow("three-fields4") << "a = b;secure;domain=.qt.nokia.com; path=/" << cookie;
 
     cookie = QNetworkCookie();
     cookie.setName("a");
@@ -664,7 +657,7 @@
     cookie.setName("baz");
     cookie.setDomain(".qt.nokia.com");
     list.prepend(cookie);
-    QTest::newRow("complex-2") << "baz=bar; path=/; domain=qt.nokia.com, c=d,a=,foo=bar; path=/" << list;
+    QTest::newRow("complex-2") << "baz=bar; path=/; domain=.qt.nokia.com, c=d,a=,foo=bar; path=/" << list;
 
     // cookies obtained from the network:
     cookie = QNetworkCookie("id", "51706646077999719");