1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericservices/httputils/Test/t_uriparser/UriAndAuthorityTests.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,731 @@
1.4 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __URIANDAUTHORITYTESTS_H__
1.20 +#define __URIANDAUTHORITYTESTS_H__
1.21 +
1.22 +#include <e32base.h>
1.23 +
1.24 +#include "CUriAndAuthorityTest.h"
1.25 +
1.26 +//
1.27 +//
1.28 +// Uri Resolving test data
1.29 +//
1.30 +//
1.31 +
1.32 +_LIT(KBaseFile, "file://c|/data.wml");
1.33 +_LIT(KRelativeFile1, "#card2"); _LIT(KResolvedFile1, "file://c|/data.wml#card2");
1.34 +
1.35 +_LIT(KBase, "http://a/b/c/d;p?q");
1.36 +_LIT(KRelative1, "g:h"); _LIT(KResolved1, "g:h");
1.37 +_LIT(KRelative2, "g"); _LIT(KResolved2, "http://a/b/c/g");
1.38 +_LIT(KRelative3, "./g"); _LIT(KResolved3, "http://a/b/c/g");
1.39 +_LIT(KRelative4, "g/"); _LIT(KResolved4, "http://a/b/c/g/");
1.40 +_LIT(KRelative5, "/g"); _LIT(KResolved5, "http://a/g");
1.41 +_LIT(KRelative6, "//g"); _LIT(KResolved6, "http://g");
1.42 +_LIT(KRelative7, "?y"); _LIT(KResolved7, "http://a/b/c/d;p?y");
1.43 +_LIT(KRelative8, "g?y"); _LIT(KResolved8, "http://a/b/c/g?y");
1.44 +_LIT(KRelative9, "#s"); _LIT(KResolved9, "http://a/b/c/d;p?q#s");
1.45 +_LIT(KRelative10, "g#s"); _LIT(KResolved10, "http://a/b/c/g#s");
1.46 +_LIT(KRelative11, "g?y#s"); _LIT(KResolved11, "http://a/b/c/g?y#s");
1.47 +_LIT(KRelative12, ";x"); _LIT(KResolved12, "http://a/b/c/;x");
1.48 +_LIT(KRelative13, "g;x"); _LIT(KResolved13, "http://a/b/c/g;x");
1.49 +_LIT(KRelative14, "g;x?y#s"); _LIT(KResolved14, "http://a/b/c/g;x?y#s");
1.50 +_LIT(KRelative15, "."); _LIT(KResolved15, "http://a/b/c/");
1.51 +_LIT(KRelative16, "./"); _LIT(KResolved16, "http://a/b/c/");
1.52 +_LIT(KRelative17, ".."); _LIT(KResolved17, "http://a/b/");
1.53 +_LIT(KRelative18, "../"); _LIT(KResolved18, "http://a/b/");
1.54 +_LIT(KRelative19, "../g"); _LIT(KResolved19, "http://a/b/g");
1.55 +_LIT(KRelative20, "../.."); _LIT(KResolved20, "http://a/");
1.56 +_LIT(KRelative21, "../../"); _LIT(KResolved21, "http://a/");
1.57 +_LIT(KRelative22, "../../g"); _LIT(KResolved22, "http://a/g");
1.58 +
1.59 +// abnormal examples
1.60 +
1.61 +_LIT(KRelative23, "../../../g"); _LIT(KResolved23, "http://a/../g"); //The Resolved Uri as per RFC3986 is http://a/g
1.62 +_LIT(KRelative24, "../../../../g"); _LIT(KResolved24, "http://a/../../g"); //The Resolved Uri as per RFC3986 is http://a/g
1.63 +_LIT(KRelative25, "/./g"); _LIT(KResolved25, "http://a/./g"); //The Resolved Uri as per RFC3986 is http://a/g
1.64 +_LIT(KRelative26, "/../g"); _LIT(KResolved26, "http://a/../g"); //The Resolved Uri as per RFC3986 is http://a/g
1.65 +_LIT(KRelative27, "g."); _LIT(KResolved27, "http://a/b/c/g.");
1.66 +_LIT(KRelative28, ".g"); _LIT(KResolved28, "http://a/b/c/.g");
1.67 +_LIT(KRelative29, "g.."); _LIT(KResolved29, "http://a/b/c/g..");
1.68 +_LIT(KRelative30, "..g"); _LIT(KResolved30, "http://a/b/c/..g");
1.69 +
1.70 +// non sensical uses of '.' and '..'
1.71 +_LIT(KRelative31, "./../g"); _LIT(KResolved31, "http://a/b/g");
1.72 +_LIT(KRelative32, "./g/."); _LIT(KResolved32, "http://a/b/c/g/");
1.73 +_LIT(KRelative33, "g/./h"); _LIT(KResolved33, "http://a/b/c/g/h");
1.74 +_LIT(KRelative34, "g/../h"); _LIT(KResolved34, "http://a/b/c/h");
1.75 +_LIT(KRelative35, "g;x=1/./y"); _LIT(KResolved35, "http://a/b/c/g;x=1/y");
1.76 +_LIT(KRelative36, "g;x=1/../y"); _LIT(KResolved36, "http://a/b/c/y");
1.77 +
1.78 +// use of query and fragment
1.79 +_LIT(KRelative37, "g?y/./x"); _LIT(KResolved37, "http://a/b/c/g?y/./x");
1.80 +_LIT(KRelative38, "g?y/../x"); _LIT(KResolved38, "http://a/b/c/g?y/../x");
1.81 +_LIT(KRelative39, "g#s/./x"); _LIT(KResolved39, "http://a/b/c/g#s/./x");
1.82 +_LIT(KRelative40, "g#s/../x"); _LIT(KResolved40, "http://a/b/c/g#s/../x");
1.83 +
1.84 +// backwards compatiable , do relative parsing if schemes match
1.85 +_LIT(KRelative41, "http:g"); _LIT(KResolved41, "http://a/b/c/g");
1.86 +
1.87 +// possible bug if relative url is a network path with a path aswell!
1.88 +_LIT(KRelative42, "//g/h/i"); _LIT(KResolved42, "http://g/h/i");
1.89 +
1.90 +// ResolveL defect EDNPHAD-4J6EUY
1.91 +_LIT(KBaseBug1, "http://wap.h2g2.com#welcome");
1.92 +_LIT(KRelativeBug1, "funcs.wml#setup(\")"); _LIT(KResolvedBug1, "http://wap.h2g2.com/funcs.wml#setup(\")");
1.93 +
1.94 +_LIT(KBaseBug2, "http://wap.h2g2.com/welcome");
1.95 +_LIT(KRelativeBug2, "funcs.wml#setup(\")"); _LIT(KResolvedBug2, "http://wap.h2g2.com/funcs.wml#setup(\")");
1.96 +_LIT(KRelativeBug3, "home/funcs.wml#setup(\")"); _LIT(KResolvedBug3, "http://wap.h2g2.com/home/funcs.wml#setup(\")");
1.97 +
1.98 +// ResolveL defect EDNFUDN-4JYFH7
1.99 +_LIT(KBaseBug3, "http://mobile.iii.co.uk");
1.100 +_LIT(KRelativeBug4, "i/iii_splash.wbm"); _LIT(KResolvedBug4, "http://mobile.iii.co.uk/i/iii_splash.wbm");
1.101 +
1.102 +// Relative fragment defect EDNEHHO-4M5BU6 - wml/state/variables/substitution/4 -test doesn't work
1.103 +_LIT(KFragmentBase, "http://trras02.it.cellulardata.com/vswap114/htroot/wap/wml/state/variables/substitution/4/?v=dozig&ts=0003&ti=3");
1.104 +_LIT(KFragmentRelative, "#card1");
1.105 +_LIT(KFragmentResolved, "http://trras02.it.cellulardata.com/vswap114/htroot/wap/wml/state/variables/substitution/4/?v=dozig&ts=0003&ti=3#card1");
1.106 +
1.107 +//
1.108 +//
1.109 +// Uri and Authority component extraction test data
1.110 +//
1.111 +//
1.112 +
1.113 +_LIT(KComps0, "http://user:pass@location.com:1666/abcd/ada/resource.cgi;x=123;df223;2342;2323?asd=b#part");
1.114 +_LIT(KScheme0, "http");
1.115 +_LIT(KAuthority0, "user:pass@location.com:1666");
1.116 +_LIT(KPath0, "/abcd/ada/resource.cgi;x=123;df223;2342;2323");
1.117 +_LIT(KQuery0, "asd=b");
1.118 +_LIT(KFragment0, "part");
1.119 +_LIT(KUser0, "user");
1.120 +_LIT(KPass0, "pass");
1.121 +_LIT(KHost0, "location.com");
1.122 +_LIT(KUserInfo0, "user:pass");
1.123 +_LIT(KPort0, "1666");
1.124 +
1.125 +_LIT(KComps1, "http://user:pass@location.com:/abcd/ada/resource.cgi?asd=b");
1.126 +_LIT(KScheme1, "http");
1.127 +_LIT(KAuthority1, "user:pass@location.com:");
1.128 +_LIT(KPath1, "/abcd/ada/resource.cgi");
1.129 +_LIT(KQuery1, "asd=b");
1.130 +_LIT(KFragment1, "");
1.131 +_LIT(KUser1, "user");
1.132 +_LIT(KPass1, "pass");
1.133 +_LIT(KHost1, "location.com");
1.134 +_LIT(KUserInfo1, "user:pass");
1.135 +_LIT(KPort1, "");
1.136 +
1.137 +_LIT(KComps2, "http://user:pass@location.com:1666/abcd/ada/resource.cgi");
1.138 +_LIT(KScheme2, "http");
1.139 +_LIT(KAuthority2, "user:pass@location.com:1666");
1.140 +_LIT(KPath2, "/abcd/ada/resource.cgi");
1.141 +_LIT(KQuery2, "");
1.142 +_LIT(KFragment2, "");
1.143 +_LIT(KUser2, "user");
1.144 +_LIT(KPass2, "pass");
1.145 +_LIT(KHost2, "location.com");
1.146 +_LIT(KUserInfo2, "user:pass");
1.147 +_LIT(KPort2, "1666");
1.148 +
1.149 +_LIT(KComps3, "http://user:pass@location.com/abcd/ada/");
1.150 +_LIT(KScheme3, "http");
1.151 +_LIT(KAuthority3, "user:pass@location.com");
1.152 +_LIT(KPath3, "/abcd/ada/");
1.153 +_LIT(KQuery3, "");
1.154 +_LIT(KFragment3, "");
1.155 +_LIT(KUser3, "user");
1.156 +_LIT(KPass3, "pass");
1.157 +_LIT(KHost3, "location.com");
1.158 +_LIT(KUserInfo3, "user:pass");
1.159 +_LIT(KPort3, "");
1.160 +
1.161 +_LIT(KComps4, "http://user:pass@location.com");
1.162 +_LIT(KScheme4, "http");
1.163 +_LIT(KAuthority4, "user:pass@location.com");
1.164 +_LIT(KPath4, "");
1.165 +_LIT(KQuery4, "");
1.166 +_LIT(KFragment4, "");
1.167 +_LIT(KUser4, "user");
1.168 +_LIT(KPass4, "pass");
1.169 +_LIT(KHost4, "location.com");
1.170 +_LIT(KUserInfo4, "user:pass");
1.171 +_LIT(KPort4, "");
1.172 +
1.173 +_LIT(KComps5, "http://");
1.174 +_LIT(KScheme5, "http");
1.175 +_LIT(KAuthority5, "");
1.176 +_LIT(KPath5, "");
1.177 +_LIT(KQuery5, "");
1.178 +_LIT(KFragment5, "");
1.179 +_LIT(KUser5, "");
1.180 +_LIT(KPass5, "");
1.181 +_LIT(KHost5, "");
1.182 +_LIT(KUserInfo5, "");
1.183 +_LIT(KPort5, "");
1.184 +
1.185 +_LIT(KComps6, "");
1.186 +_LIT(KScheme6, "");
1.187 +_LIT(KAuthority6, "");
1.188 +_LIT(KPath6, "");
1.189 +_LIT(KQuery6, "");
1.190 +_LIT(KFragment6, "");
1.191 +_LIT(KUser6, "");
1.192 +_LIT(KPass6, "");
1.193 +_LIT(KHost6, "");
1.194 +_LIT(KUserInfo6, "");
1.195 +_LIT(KPort6, "");
1.196 +
1.197 +_LIT(KComps10, "http://user:pass@location.com/abcd/ada/resource.cgi?asd=b#pa://rt");
1.198 +_LIT(KScheme10, "http");
1.199 +_LIT(KAuthority10, "user:pass@location.com");
1.200 +_LIT(KPath10, "/abcd/ada/resource.cgi");
1.201 +_LIT(KQuery10, "asd=b");
1.202 +_LIT(KFragment10, "pa://rt");
1.203 +_LIT(KUser10, "user");
1.204 +_LIT(KPass10, "pass");
1.205 +_LIT(KHost10, "location.com");
1.206 +_LIT(KUserInfo10, "user:pass");
1.207 +_LIT(KPort10, "");
1.208 +
1.209 +_LIT(KComps11, "http://user:pass@location.com/abcd/ada/resource.cgi?as/d=b#pa://rt");
1.210 +_LIT(KScheme11, "http");
1.211 +_LIT(KAuthority11, "user:pass@location.com");
1.212 +_LIT(KPath11, "/abcd/ada/resource.cgi");
1.213 +_LIT(KQuery11, "as/d=b");
1.214 +_LIT(KFragment11, "pa://rt");
1.215 +_LIT(KUser11, "user");
1.216 +_LIT(KPass11, "pass");
1.217 +_LIT(KHost11, "location.com");
1.218 +_LIT(KUserInfo11, "user:pass");
1.219 +_LIT(KPort11, "");
1.220 +
1.221 +_LIT(KComps12, "http://user:pass@location.com/abcd/ada/reso://urce.cgi?asd=b#pa://rt");
1.222 +_LIT(KScheme12, "http");
1.223 +_LIT(KAuthority12, "user:pass@location.com");
1.224 +_LIT(KPath12, "/abcd/ada/reso://urce.cgi");
1.225 +_LIT(KQuery12, "asd=b");
1.226 +_LIT(KFragment12, "pa://rt");
1.227 +_LIT(KUser12, "user");
1.228 +_LIT(KPass12, "pass");
1.229 +_LIT(KHost12, "location.com");
1.230 +_LIT(KUserInfo12, "user:pass");
1.231 +_LIT(KPort12, "");
1.232 +
1.233 +_LIT(KComps13, "http://user:pass@location.com/abc://d/ada/resource.cgi?asd=b#pa://rt");
1.234 +_LIT(KScheme13, "http");
1.235 +_LIT(KAuthority13, "user:pass@location.com");
1.236 +_LIT(KPath13, "/abc://d/ada/resource.cgi");
1.237 +_LIT(KQuery13, "asd=b");
1.238 +_LIT(KFragment13, "pa://rt");
1.239 +_LIT(KUser13, "user");
1.240 +_LIT(KPass13, "pass");
1.241 +_LIT(KHost13, "location.com");
1.242 +_LIT(KUserInfo13, "user:pass");
1.243 +_LIT(KPort13, "");
1.244 +
1.245 +_LIT(KComps14, "http://user:pass@loc://ation.com/abcd/ada/resource.cgi?asd=b#pa://rt");
1.246 +_LIT(KScheme14, "http");
1.247 +_LIT(KAuthority14, "user:pass@loc:");
1.248 +_LIT(KPath14, "//ation.com/abcd/ada/resource.cgi");
1.249 +_LIT(KQuery14, "asd=b");
1.250 +_LIT(KFragment14, "pa://rt");
1.251 +_LIT(KUser14, "user");
1.252 +_LIT(KPass14, "pass");
1.253 +_LIT(KHost14, "loc");
1.254 +_LIT(KUserInfo14, "user:pass");
1.255 +_LIT(KPort14, "");
1.256 +
1.257 +_LIT(KComps15, "ht~tp://user:pass@location.com/abcd/ada/resource.cgi?asd=b#pa://rt");
1.258 +_LIT(KScheme15, "ht~tp");
1.259 +_LIT(KAuthority15, "user:pass@location.com");
1.260 +_LIT(KPath15, "/abcd/ada/resource.cgi");
1.261 +_LIT(KQuery15, "asd=b");
1.262 +_LIT(KFragment15, "pa://rt");
1.263 +_LIT(KUser15, "user");
1.264 +_LIT(KPass15, "pass");
1.265 +_LIT(KHost15, "location.com");
1.266 +_LIT(KUserInfo15, "user:pass");
1.267 +_LIT(KPort15, "");
1.268 +
1.269 +_LIT(KComps16, "user:pass@location.com/abcd/ada/resource.cgi?asd=b#pa://rt");
1.270 +_LIT(KScheme16, "user");
1.271 +_LIT(KAuthority16, "");
1.272 +_LIT(KPath16, "pass@location.com/abcd/ada/resource.cgi");
1.273 +_LIT(KQuery16, "asd=b");
1.274 +_LIT(KFragment16, "pa://rt");
1.275 +_LIT(KUser16, "");
1.276 +_LIT(KPass16, "");
1.277 +_LIT(KHost16, "");
1.278 +_LIT(KUserInfo16, "");
1.279 +_LIT(KPort16, "");
1.280 +
1.281 +_LIT(KComps17, "/abcd/ada/resource.cgi?asd=b#pa://rt");
1.282 +_LIT(KScheme17, "");
1.283 +_LIT(KAuthority17, "");
1.284 +_LIT(KPath17, "/abcd/ada/resource.cgi");
1.285 +_LIT(KQuery17, "asd=b");
1.286 +_LIT(KFragment17, "pa://rt");
1.287 +_LIT(KUser17, "");
1.288 +_LIT(KPass17, "");
1.289 +_LIT(KHost17, "");
1.290 +_LIT(KUserInfo17, "");
1.291 +_LIT(KPort17, "");
1.292 +
1.293 +_LIT(KComps18, "resource.cgi?asd=b#pa://rt");
1.294 +_LIT(KScheme18, "");
1.295 +_LIT(KAuthority18, "");
1.296 +_LIT(KPath18, "resource.cgi");
1.297 +_LIT(KQuery18, "asd=b");
1.298 +_LIT(KFragment18, "pa://rt");
1.299 +_LIT(KUser18, "");
1.300 +_LIT(KPass18, "");
1.301 +_LIT(KHost18, "");
1.302 +_LIT(KUserInfo18, "");
1.303 +_LIT(KPort18, "");
1.304 +
1.305 +_LIT(KComps19, "?asd=b#pa://rt");
1.306 +_LIT(KScheme19, "");
1.307 +_LIT(KAuthority19, "");
1.308 +_LIT(KPath19, "");
1.309 +_LIT(KQuery19, "asd=b");
1.310 +_LIT(KFragment19, "pa://rt");
1.311 +_LIT(KUser19, "");
1.312 +_LIT(KPass19, "");
1.313 +_LIT(KHost19, "");
1.314 +_LIT(KUserInfo19, "");
1.315 +_LIT(KPort19, "");
1.316 +
1.317 +_LIT(KComps20, "#pa://rt");
1.318 +_LIT(KScheme20, "");
1.319 +_LIT(KAuthority20, "");
1.320 +_LIT(KPath20, "");
1.321 +_LIT(KQuery20, "");
1.322 +_LIT(KFragment20, "pa://rt");
1.323 +_LIT(KUser20, "");
1.324 +_LIT(KPass20, "");
1.325 +_LIT(KHost20, "");
1.326 +_LIT(KUserInfo20, "");
1.327 +_LIT(KPort20, "");
1.328 +
1.329 +_LIT(KComps21, "resource.cgi");
1.330 +_LIT(KScheme21, "");
1.331 +_LIT(KAuthority21, "");
1.332 +_LIT(KPath21, "resource.cgi");
1.333 +_LIT(KQuery21, "");
1.334 +_LIT(KFragment21, "");
1.335 +_LIT(KUser21, "");
1.336 +_LIT(KPass21, "");
1.337 +_LIT(KHost21, "");
1.338 +_LIT(KUserInfo21, "");
1.339 +_LIT(KPort21, "");
1.340 +
1.341 +_LIT(KComps22, "?q#f");
1.342 +_LIT(KScheme22, "");
1.343 +_LIT(KAuthority22, "");
1.344 +_LIT(KPath22, "");
1.345 +_LIT(KQuery22, "q");
1.346 +_LIT(KFragment22, "f");
1.347 +_LIT(KUser22, "");
1.348 +_LIT(KPass22, "");
1.349 +_LIT(KHost22, "");
1.350 +_LIT(KUserInfo22, "");
1.351 +_LIT(KPort22, "");
1.352 +
1.353 +_LIT(KComps23, "?q");
1.354 +_LIT(KScheme23, "");
1.355 +_LIT(KAuthority23, "");
1.356 +_LIT(KPath23, "");
1.357 +_LIT(KQuery23, "q");
1.358 +_LIT(KFragment23, "");
1.359 +_LIT(KUser23, "");
1.360 +_LIT(KPass23, "");
1.361 +_LIT(KHost23, "");
1.362 +_LIT(KUserInfo23, "");
1.363 +_LIT(KPort23, "");
1.364 +
1.365 +_LIT(KComps24, "#f");
1.366 +_LIT(KScheme24, "");
1.367 +_LIT(KAuthority24, "");
1.368 +_LIT(KPath24, "");
1.369 +_LIT(KQuery24, "");
1.370 +_LIT(KFragment24, "f");
1.371 +_LIT(KUser24, "");
1.372 +_LIT(KPass24, "");
1.373 +_LIT(KHost24, "");
1.374 +_LIT(KUserInfo24, "");
1.375 +_LIT(KPort24, "");
1.376 +
1.377 +_LIT(KComps25, "http://location.com/abcd/ada/resource.cgi?asd=b#pa://rt");
1.378 +_LIT(KScheme25, "http");
1.379 +_LIT(KAuthority25, "location.com");
1.380 +_LIT(KPath25, "/abcd/ada/resource.cgi");
1.381 +_LIT(KQuery25, "asd=b");
1.382 +_LIT(KFragment25, "pa://rt");
1.383 +_LIT(KUser25, "");
1.384 +_LIT(KPass25, "");
1.385 +_LIT(KHost25, "location.com");
1.386 +_LIT(KUserInfo25, "");
1.387 +_LIT(KPort25, "");
1.388 +
1.389 +_LIT(KComps26, "http://user@location.com/abcd/ada/resource.cgi?asd=b#pa://rt");
1.390 +_LIT(KScheme26, "http");
1.391 +_LIT(KAuthority26, "user@location.com");
1.392 +_LIT(KPath26, "/abcd/ada/resource.cgi");
1.393 +_LIT(KQuery26, "asd=b");
1.394 +_LIT(KFragment26, "pa://rt");
1.395 +_LIT(KUser26, "user");
1.396 +_LIT(KPass26, "");
1.397 +_LIT(KHost26, "location.com");
1.398 +_LIT(KUserInfo26, "user");
1.399 +_LIT(KPort26, "");
1.400 +
1.401 +_LIT(KComps27, "http://wap.opengroup.org/");
1.402 +_LIT(KScheme27, "http");
1.403 +_LIT(KAuthority27, "wap.opengroup.org");
1.404 +_LIT(KPath27, "/");
1.405 +_LIT(KQuery27, "");
1.406 +_LIT(KFragment27, "");
1.407 +_LIT(KUser27, "");
1.408 +_LIT(KPass27, "");
1.409 +_LIT(KHost27, "wap.opengroup.org");
1.410 +_LIT(KUserInfo27, "");
1.411 +_LIT(KPort27, "");
1.412 +
1.413 +_LIT(KComps28, "http://wap.opengroup.org/#index.wml");
1.414 +_LIT(KScheme28, "http");
1.415 +_LIT(KAuthority28, "wap.opengroup.org");
1.416 +_LIT(KPath28, "/");
1.417 +_LIT(KQuery28, "");
1.418 +_LIT(KFragment28, "index.wml");
1.419 +_LIT(KUser28, "");
1.420 +_LIT(KPass28, "");
1.421 +_LIT(KHost28, "wap.opengroup.org");
1.422 +_LIT(KUserInfo28, "");
1.423 +_LIT(KPort28, "");
1.424 +
1.425 +_LIT(KComps29, "http://wap.opengroup.org/?mystuff");
1.426 +_LIT(KScheme29, "http");
1.427 +_LIT(KAuthority29, "wap.opengroup.org");
1.428 +_LIT(KPath29, "/");
1.429 +_LIT(KQuery29, "mystuff");
1.430 +_LIT(KFragment29, "");
1.431 +_LIT(KUser29, "");
1.432 +_LIT(KPass29, "");
1.433 +_LIT(KHost29, "wap.opengroup.org");
1.434 +_LIT(KUserInfo29, "");
1.435 +_LIT(KPort29, "");
1.436 +
1.437 +
1.438 +// IPv6 test cases
1.439 +
1.440 +_LIT(KComps30, "http://user:pass@[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:1666/abcd/ada/resource.cgi;x=123;df223;2342;2323?asd=b#part");
1.441 +_LIT(KScheme30, "http");
1.442 +_LIT(KAuthority30, "user:pass@[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:1666");
1.443 +_LIT(KPath30, "/abcd/ada/resource.cgi;x=123;df223;2342;2323");
1.444 +_LIT(KQuery30, "asd=b");
1.445 +_LIT(KFragment30, "part");
1.446 +_LIT(KUser30, "user");
1.447 +_LIT(KPass30, "pass");
1.448 +_LIT(KHost30, "FEDC:BA98:7654:3210:FEDC:BA98:7654:3210");
1.449 +_LIT(KUserInfo30, "user:pass");
1.450 +_LIT(KPort30, "1666");
1.451 +
1.452 +_LIT(KComps31, "http://user:pass@[1080:0:0:0:8:800:200C:417A]:1666/abcd/ada/resource.cgi;x=123;df223;2342;2323?asd=b#part");
1.453 +_LIT(KScheme31, "http");
1.454 +_LIT(KAuthority31, "user:pass@[1080:0:0:0:8:800:200C:417A]:1666");
1.455 +_LIT(KPath31, "/abcd/ada/resource.cgi;x=123;df223;2342;2323");
1.456 +_LIT(KQuery31, "asd=b");
1.457 +_LIT(KFragment31, "part");
1.458 +_LIT(KUser31, "user");
1.459 +_LIT(KPass31, "pass");
1.460 +_LIT(KHost31, "1080:0:0:0:8:800:200C:417A");
1.461 +_LIT(KUserInfo31, "user:pass");
1.462 +_LIT(KPort31, "1666");
1.463 +
1.464 +_LIT(KComps32, "http://user:pass@[3ffe:2a00:100:7031::1]:1666/abcd/ada/resource.cgi;x=123;df223;2342;2323?asd=b#part");
1.465 +_LIT(KScheme32, "http");
1.466 +_LIT(KAuthority32, "user:pass@[3ffe:2a00:100:7031::1]:1666");
1.467 +_LIT(KPath32, "/abcd/ada/resource.cgi;x=123;df223;2342;2323");
1.468 +_LIT(KQuery32, "asd=b");
1.469 +_LIT(KFragment32, "part");
1.470 +_LIT(KUser32, "user");
1.471 +_LIT(KPass32, "pass");
1.472 +_LIT(KHost32, "3ffe:2a00:100:7031::1");
1.473 +_LIT(KUserInfo32, "user:pass");
1.474 +_LIT(KPort32, "1666");
1.475 +
1.476 +_LIT(KComps33, "http://user:pass@[1080::8:800:200C:417A]:1666/abcd/ada/resource.cgi;x=123;df223;2342;2323?asd=b#part");
1.477 +_LIT(KScheme33, "http");
1.478 +_LIT(KAuthority33, "user:pass@[1080::8:800:200C:417A]:1666");
1.479 +_LIT(KPath33, "/abcd/ada/resource.cgi;x=123;df223;2342;2323");
1.480 +_LIT(KQuery33, "asd=b");
1.481 +_LIT(KFragment33, "part");
1.482 +_LIT(KUser33, "user");
1.483 +_LIT(KPass33, "pass");
1.484 +_LIT(KHost33, "1080::8:800:200C:417A");
1.485 +_LIT(KUserInfo33, "user:pass");
1.486 +_LIT(KPort33, "1666");
1.487 +
1.488 +_LIT(KComps34, "http://user:pass@[::192.9.5.5]:1666/abcd/ada/resource.cgi;x=123;df223;2342;2323?asd=b#part");
1.489 +_LIT(KScheme34, "http");
1.490 +_LIT(KAuthority34, "user:pass@[::192.9.5.5]:1666");
1.491 +_LIT(KPath34, "/abcd/ada/resource.cgi;x=123;df223;2342;2323");
1.492 +_LIT(KQuery34, "asd=b");
1.493 +_LIT(KFragment34, "part");
1.494 +_LIT(KUser34, "user");
1.495 +_LIT(KPass34, "pass");
1.496 +_LIT(KHost34, "::192.9.5.5");
1.497 +_LIT(KUserInfo34, "user:pass");
1.498 +_LIT(KPort34, "1666");
1.499 +
1.500 +_LIT(KComps35, "http://user:pass@[::FfFf:129.144.52.38]:1666/abcd/ada/resource.cgi;x=123;df223;2342;2323?asd=b#part");
1.501 +_LIT(KScheme35, "http");
1.502 +_LIT(KAuthority35, "user:pass@[::FfFf:129.144.52.38]:1666");
1.503 +_LIT(KPath35, "/abcd/ada/resource.cgi;x=123;df223;2342;2323");
1.504 +_LIT(KQuery35, "asd=b");
1.505 +_LIT(KFragment35, "part");
1.506 +_LIT(KUser35, "user");
1.507 +_LIT(KPass35, "pass");
1.508 +_LIT(KHost35, "::FfFf:129.144.52.38");
1.509 +_LIT(KUserInfo35, "user:pass");
1.510 +_LIT(KPort35, "1666");
1.511 +
1.512 +_LIT(KComps36, "http://user:pass@[2010:836B:4179::836B:4179]:1666/abcd/ada/resource.cgi;x=123;df223;2342;2323?asd=b#part");
1.513 +_LIT(KScheme36, "http");
1.514 +_LIT(KAuthority36, "user:pass@[2010:836B:4179::836B:4179]:1666");
1.515 +_LIT(KPath36, "/abcd/ada/resource.cgi;x=123;df223;2342;2323");
1.516 +_LIT(KQuery36, "asd=b");
1.517 +_LIT(KFragment36, "part");
1.518 +_LIT(KUser36, "user");
1.519 +_LIT(KPass36, "pass");
1.520 +_LIT(KHost36, "2010:836B:4179::836B:4179");
1.521 +_LIT(KUserInfo36, "user:pass");
1.522 +_LIT(KPort36, "1666");
1.523 +
1.524 +
1.525 +_LIT(KFileName1, "http://www.symbian.com"); _LIT(KFileNameExpected1, "");
1.526 +_LIT(KFileName2, "http://www.symbian.com/"); _LIT(KFileNameExpected2, "");
1.527 +_LIT(KFileName3, "http://www.symbian.com/images/"); _LIT(KFileNameExpected3, "");
1.528 +_LIT(KFileName4, "http://www.symbian.com/images"); _LIT(KFileNameExpected4, "images");
1.529 +_LIT(KFileName5, "http://www.symbian.com/images/epoc/img1.jpg"); _LIT(KFileNameExpected5, "img1.jpg");
1.530 +_LIT(KFileName6, "http://www.symbian.com/file.txt"); _LIT(KFileNameExpected6, "file.txt");
1.531 +
1.532 +//
1.533 +//
1.534 +// Misc test data
1.535 +//
1.536 +//
1.537 +
1.538 +// TestCompare input data
1.539 +//
1.540 +//_LIT(KUrl0,"http://user:pass@location.com/abcd/ada/resource.cgi;x=123;df223;2342;2323?asd=b#part"); // SLPRQG
1.541 +_LIT(KUrl0,"http://user:pass@location.com/abcd/ada/resource.cgi?asd=b#part"); // SLPRQG
1.542 +_LIT(KUrl1,"http://user:pass@location.com/abcd/ada/resource.cgi?asd=b"); // SLPRQ
1.543 +_LIT(KUrl2,"http://user:pass@location.com/abcd/ada/resource.cgi"); // SLPR
1.544 +_LIT(KUrl3,"http://user:pass@location.com/abcd/ada/"); // SLP
1.545 +_LIT(KUrl4,"http://user:pass@location.com"); // SL
1.546 +_LIT(KUrl5,"http://"); // S
1.547 +_LIT(KUrl6,""); //
1.548 +
1.549 +_LIT(KUrl10,"http://user:pass@location.com/abcd/ada/resource.cgi?asd=b#pa://rt"); // SLPRQg
1.550 +_LIT(KUrl11,"http://user:pass@location.com/abcd/ada/resource.cgi?as/d=b#pa://rt"); // SLPRqG
1.551 +_LIT(KUrl12,"http://user:pass@location.com/abcd/ada/reso://urce.cgi?asd=b#pa://rt"); // SLPrQG
1.552 +_LIT(KUrl13,"http://user:pass@location.com/abc://d/ada/resource.cgi?asd=b#pa://rt"); // SLpRQG
1.553 +_LIT(KUrl14,"http://user:pass@loc://ation.com/abcd/ada/resource.cgi?asd=b#pa://rt"); // SlPRQG
1.554 +_LIT(KUrl15,"ht~tp://user:pass@location.com/abcd/ada/resource.cgi?asd=b#pa://rt"); // sLPRQG
1.555 +
1.556 +_LIT(KUrl16,"user:pass@location.com/abcd/ada/resource.cgi?asd=b#pa://rt"); // SLPRQg
1.557 +_LIT(KUrl17,"/abcd/ada/resource.cgi?asd=b#pa://rt"); // SLPRQg
1.558 +_LIT(KUrl18,"resource.cgi?asd=b#pa://rt"); // SLPRQg
1.559 +_LIT(KUrl19,"?asd=b#pa://rt"); // SLPRQg
1.560 +_LIT(KUrl20,"#pa://rt"); // SLPRQg
1.561 +_LIT(KUrl21,"resource.cgi"); // SLPRQg
1.562 +
1.563 +// Construct with TParseBase test data
1.564 +//
1.565 +_LIT(KParse0, "c:\\system\\data.wml"); _LIT(KParseResult0, "file://c|/system/data.wml");
1.566 +_LIT(KParse1, "c:\\wap files\\test.wml"); _LIT(KParseResult1, "file://c|/wap%20files/test.wml"); // Defect EDNTDAS-4N4K72
1.567 +
1.568 +// Unescape url creation test data
1.569 +//
1.570 +_LIT(KEscapedString0, "the%20%25%5E%20weather"); _LIT(KUnescapedString0, "the %^ weather");
1.571 +_LIT(KEscapedString1, "%7Bcheck%3C%3Ethis%5B%5Dout%7D"); _LIT(KUnescapedString1, "{check<>this[]out}");
1.572 +_LIT(KEscapedString2a, "Reserved;/?:@&=+$,"); _LIT(KUnescapedString2, "Reserved;/?:@&=+$,");
1.573 +_LIT(KEscapedString2b, "Reserved%3B%2F%3F%3A%40%26%3D%2B%24%2C");
1.574 +
1.575 +
1.576 +// Construction defect EDNFUDN-4K9MD8
1.577 +//
1.578 +_LIT(KCtorUrl0, ":\\http://www.bbc.co.uk/mobile/mainmenu.wml");
1.579 +
1.580 +_LIT(KRubbish, "rubbish");
1.581 +_LIT(KSlashRubbish, "/rubbish");
1.582 +
1.583 +// Leading whitespace defect EDNEPTA-4PBHSE - WAP:Go-element causes breakpoint if href-attribute has space in its beginning
1.584 +_LIT(KLeadWhitespace1, " http://wap.iobox.com"); _LIT(KLeadWhitespaceUrl, "http://wap.iobox.com");
1.585 +_LIT(KLeadWhitespace2, " http://wap.iobox.com");
1.586 +
1.587 +//
1.588 +//
1.589 +// Uri test data
1.590 +//
1.591 +//
1.592 +
1.593 +_LIT(KUri_IPv6Fragment0,"http://userinfo@[::FfFf:129.144.52.38]:port/a/b/c?query#fragment"); // with fragment
1.594 +_LIT(KUri_IPv6Query0, "http://userinfo@[::FfFf:129.144.52.38]:port/a/b/c?query"); // with query
1.595 +_LIT(KUri_IPv6Path0, "http://userinfo@[::FfFf:129.144.52.38]:port/a/b/c"); // with path
1.596 +_LIT(KUri_IPv6Port0, "http://userinfo@[::FfFf:129.144.52.38]:port"); // with port
1.597 +_LIT(KUri_IPv6UserInfo0,"http://userinfo@[::FfFf:129.144.52.38]"); // with userinfo
1.598 +_LIT(KUri_IPv6Host0, "http://[::FfFf:129.144.52.38]"); // with scheme
1.599 +
1.600 +
1.601 +
1.602 +
1.603 +
1.604 +_LIT(KUri_IPv6HostComp0, "::FfFf:129.144.52.38");
1.605 +
1.606 +_LIT(KUri_Fragment0, "http://userinfo@host:port/a/b/c?query#fragment"); // With fragment
1.607 +_LIT(KUri_Query0, "http://userinfo@host:port/a/b/c?query"); // With query
1.608 +_LIT(KUri_Path0, "http://userinfo@host:port/a/b/c"); // With path
1.609 +_LIT(KUri_Port0, "http://userinfo@host:port"); // With port
1.610 +_LIT(KUri_Userinfo0, "http://userinfo@host"); // With userinfo
1.611 +_LIT(KUri_Host0, "http://host"); // With host
1.612 +_LIT(KUri_Scheme0, "http:"); // With scheme
1.613 +
1.614 +_LIT(KUri_SchemeComp0, "http");
1.615 +_LIT(KUri_UserinfoComp0, "userinfo");
1.616 +_LIT(KUri_HostComp0, "host");
1.617 +_LIT(KUri_PortComp0, "port");
1.618 +_LIT(KUri_PathComp0, "/a/b/c");
1.619 +_LIT(KUri_QueryComp0, "query");
1.620 +_LIT(KUri_FragmentComp0, "fragment");
1.621 +
1.622 +_LIT(KUri_Compare0_a, "http://user@www.symbian.com:1666/wap/dev/my.wml?name=dave#card1");
1.623 +_LIT(KUri_Compare0_b, "http://user@www.symbian.com:1666/wap/dev/my.wml?name=dave#card1");
1.624 +const TInt KUriMatchFlags0 = (ESchemeFlag | EUserinfoFlag | EHostFlag | EPortFlag | EPathFlag | EQueryFlag | EFragmentFlag);
1.625 +
1.626 +_LIT(KUri_Compare1_a, "http://user@www.symbian.com:1666/wap/dev/my.wml?name=dave#card1");
1.627 +_LIT(KUri_Compare1_b, "HTTP://USER@Www.symbian.com:1666/wap/dev/different.wml?name=dave#card1");
1.628 +const TInt KUriMatchFlags1 = (ESchemeFlag | EHostFlag | EPortFlag | EQueryFlag | EFragmentFlag);
1.629 +
1.630 +_LIT(KUri_Compare2_a, "http://user:pass@[fEdC:Ba98:7654:3210:FeDC:BA98:7654:3210]:1666/abcd/ada/resource.cgi;x=123;df223;2342;2323?asd=b#part");
1.631 +_LIT(KUri_Compare2_b, "http://user:pass@[FEDC:BA98:7654:3210:fedc:BA98:7654:3210]:1666/abcd/ada/resource.cgi;x=123;df223;2342;2323?asd=b#part");
1.632 +const TInt KUriMatchFlags2 = (ESchemeFlag | EUserinfoFlag | EHostFlag | EPortFlag | EPathFlag | EQueryFlag | EFragmentFlag);
1.633 +
1.634 +_LIT(KUri_Compare3_a, "http://Auser:pass@[::FfFf:129.144.52.38]:1666/abcd/ada/resource.cgi;x=123;df223;2342;2323?asd=b#part");
1.635 +_LIT(KUri_Compare3_b, "http://Buser:pass@[::FfFf:129.144.52.38]:1666/abcd/ada/resource.cgi;x=123;df223;2342;2323?asd=b#part");
1.636 +const TInt KUriMatchFlags3 = (ESchemeFlag | EHostFlag | EPortFlag | EPathFlag | EQueryFlag | EFragmentFlag);
1.637 +
1.638 +
1.639 +
1.640 +_LIT(KUri_SchemeValidation0, "http://user@www.symbian.com:1666/wap/dev/my.wml?name=dave#card1");
1.641 +TBool KUri_SchemeValidity0 = ETrue;
1.642 +
1.643 +_LIT(KUri_SchemeValidation1, "ht~tp://user@www.symbian.com:1666/wap/dev/my.wml?name=dave#card1");
1.644 +TBool KUri_SchemeValidity1 = EFalse;
1.645 +
1.646 +_LIT(KUri_WithoutFragment0, "http://user@www.symbian.com:1666/wap/dev/my.wml?name=dave#card1");
1.647 +_LIT(KUri_WithoutFragment_Result0, "http://user@www.symbian.com:1666/wap/dev/my.wml?name=dave");
1.648 +
1.649 +_LIT(KUri_WithoutFragment1, "http://user@www.symbian.com:1666/wap/dev/my.wml?name=dave");
1.650 +_LIT(KUri_WithoutFragment_Result1, "http://user@www.symbian.com:1666/wap/dev/my.wml?name=dave");
1.651 +
1.652 +_LIT(KUri_Whole0, "http://userinfo@host:port/a/b/c?query#fragment"); // Whole uri
1.653 +_LIT(KUri_NoFragment0, "http://userinfo@host:port/a/b/c?query"); // Without fragment
1.654 +_LIT(KUri_NoQuery0, "http://userinfo@host:port/a/b/c"); // Without query
1.655 +_LIT(KUri_NoPath0, "http://userinfo@host:port"); // Without path
1.656 +_LIT(KUri_NoPort0, "http://userinfo@host"); // Without port
1.657 +_LIT(KUri_NoUserinfo0, "http://host"); // Without userinfo
1.658 +_LIT(KUri_NoHost0, "http:"); // Without host
1.659 +_LIT(KUri_NoScheme0, ""); // Without scheme
1.660 +
1.661 +_LIT(KUri_IPv6Whole0, "http://userinfo@[::FfFf:129.144.52.38]:port/a/b/c?query#fragment"); // Whole uri
1.662 +_LIT(KUri_IPv6NoFragment0, "http://userinfo@[::FfFf:129.144.52.38]:port/a/b/c?query"); // Without fragment
1.663 +_LIT(KUri_IPv6NoQuery0, "http://userinfo@[::FfFf:129.144.52.38]:port/a/b/c"); // Without query
1.664 +_LIT(KUri_IPv6NoPath0, "http://userinfo@[::FfFf:129.144.52.38]:port"); // Without path
1.665 +_LIT(KUri_IPv6NoPort0, "http://userinfo@[::FfFf:129.144.52.38]"); // Without port
1.666 +_LIT(KUri_IPv6NoUserinfo0, "http://[::FfFf:129.144.52.38]"); // Without userinfo
1.667 +_LIT(KUri_IPv6NoHost0, "http:"); // Without host
1.668 +_LIT(KUri_IPv6NoScheme0, "");
1.669 +
1.670 +_LIT(KUri_Presence0, "http://user@www.symbian.com:1666/wap/dev/my.wml?name=dave#card1");
1.671 +const TInt KUriPresenceFlags0 = (ESchemeFlag | EUserinfoFlag | EHostFlag | EPortFlag | EPathFlag | EQueryFlag | EFragmentFlag);
1.672 +
1.673 +_LIT(KUri_Presence1, "http://www.symbian.com:1666?name=dave");
1.674 +const TInt KUriPresenceFlags1 = (ESchemeFlag | EHostFlag | EPortFlag | EPathFlag | EQueryFlag );
1.675 +
1.676 +_LIT(KAuthority_Presence0, "user@www.symbian.com:1666");
1.677 +const TInt KAuthorityPresenceFlags0 = (EUserinfoFlag | EHostFlag | EPortFlag );
1.678 +
1.679 +_LIT(KAuthority_Presence1, "www.symbian.com");
1.680 +const TInt KAuthorityPresenceFlags1 = (EHostFlag);
1.681 +
1.682 +_LIT(KUri_Des0, "http://user@www.symbian.com:1666/wap/dev/my.wml?name=dave#card1");
1.683 +
1.684 +//
1.685 +//
1.686 +// Authority test data
1.687 +//
1.688 +//
1.689 +
1.690 +_LIT(KAuth_Compare0_a, "user@www.symbian.com:1666");
1.691 +_LIT(KAuth_Compare0_b, "user@www.symbian.com:1666");
1.692 +const TInt KAuthMatchFlags0 = (EUserinfoFlag | EHostFlag | EPortFlag);
1.693 +
1.694 +_LIT(KAuth_Compare1_a, "user@www.symbian.com:1666");
1.695 +_LIT(KAuth_Compare1_b, "USER@Www.symbian.com:1666");
1.696 +const TInt KAuthMatchFlags1 = (EHostFlag | EPortFlag);
1.697 +
1.698 +_LIT(KAuthority_Des0, "user@www.symbian.com:1666");
1.699 +
1.700 +_LIT(KAuthority_Port0, "userinfo@host:port"); // With port
1.701 +_LIT(KAuthority_Userinfo0, "userinfo@host"); // With userinfo
1.702 +_LIT(KAuthority_Host0, "host"); // With host
1.703 +
1.704 +_LIT(KAuthority_UserinfoComp0, "userinfo");
1.705 +_LIT(KAuthority_HostComp0, "host");
1.706 +_LIT(KAuthority_PortComp0, "port");
1.707 +
1.708 +_LIT(KAuthorityEscaped_Port0, "some%3Astuff@host%2Fname:port%3Fnum"); // With port
1.709 +_LIT(KAuthorityEscaped_Userinfo0, "some%3Astuff@host%2Fname"); // With userinfo
1.710 +_LIT(KAuthorityEscaped_Host0, "host%2Fname"); // With host
1.711 +
1.712 +_LIT(KAuthorityEscaped_UserinfoComp0, "some:stuff");
1.713 +_LIT(KAuthorityEscaped_HostComp0, "host/name");
1.714 +_LIT(KAuthorityEscaped_PortComp0, "port?num");
1.715 +
1.716 +_LIT(KAuthority_Whole0, "userinfo@host:port"); // Whole authority
1.717 +_LIT(KAuthority_NoPort0, "userinfo@host"); // Without port
1.718 +_LIT(KAuthority_NoUserinfo0, "host"); // Without userinfo
1.719 +_LIT(KAuthority_NoHost0, ""); // Without host
1.720 +
1.721 +_LIT(KAuthority_IPv6Whole0, "userinfo@[::FfFf:129.144.52.38]:port"); // Whole authority
1.722 +_LIT(KAuthority_IPv6NoPort0, "userinfo@[::FfFf:129.144.52.38]"); // Without port
1.723 +_LIT(KAuthority_IPv6NoUserinfo0, "[::FfFf:129.144.52.38]"); // Without userinfo
1.724 +_LIT(KAuthority_IPv6NoHost0, "");
1.725 +
1.726 +_LIT(KAuthority_IPv6Port0, "userinfo@[::FfFf:129.144.52.38]:port"); // With port
1.727 +_LIT(KAuthority_IPv6Userinfo0, "userinfo@[::FfFf:129.144.52.38]"); // With userinfo
1.728 +_LIT(KAuthority_IPv6Host0, "[::FfFf:129.144.52.38]"); // With host
1.729 +
1.730 +_LIT(KAuthority_IPv6UserinfoComp0, "userinfo");
1.731 +_LIT(KAuthority_IPv6HostComp0, "::FfFf:129.144.52.38");
1.732 +_LIT(KAuthority_IPv6PortComp0, "port");
1.733 +
1.734 +#endif // __URIANDAUTHORITYTESTS_H__