lluri_tut.cpp

Go to the documentation of this file.
00001 
00033 #include "linden_common.h"
00034 #include "lltut.h"
00035 #include "llsd.h"
00036 #include "lluri.h"
00037 #include "llhost.h"
00038 
00039 namespace tut
00040 {
00041         struct URITestData {
00042                 void checkParts(const LLURI& u,
00043                                 const char* expectedScheme,
00044                                 const char* expectedOpaque,
00045                                 const char* expectedAuthority,
00046                                 const char* expectedPath,
00047                                 const char* expectedQuery = "")
00048                 {
00049                         ensure_equals("scheme",         u.scheme(),             expectedScheme);
00050                         ensure_equals("opaque",         u.opaque(),             expectedOpaque);
00051                         ensure_equals("authority",      u.authority(),  expectedAuthority);
00052                         ensure_equals("path",           u.path(),               expectedPath);
00053                         ensure_equals("query",          u.query(),              expectedQuery);
00054                 }
00055 
00056                 void escapeRoundTrip(const std::string& uri_raw_1)
00057                 {
00058                         std::string uri_esc_1(LLURI::escape(uri_raw_1));
00059                         std::string uri_raw_2(LLURI::unescape(uri_esc_1));
00060                         ensure_equals("escape/unescape raw", uri_raw_2, uri_raw_1);
00061                         std::string uri_esc_2(LLURI::escape(uri_raw_2));
00062                         ensure_equals("escape/unescape escaped", uri_esc_2, uri_esc_1);
00063                 }
00064         };
00065         
00066         typedef test_group<URITestData> URITestGroup;
00067         typedef URITestGroup::object    URITestObject;
00068 
00069         URITestGroup uriTestGroup("LLURI");
00070         
00071         template<> template<>
00072         void URITestObject::test<1>()
00073         {
00074                 LLURI u("http://abc.com/def/ghi?x=37&y=hello");
00075 
00076                 ensure_equals("scheme",         u.scheme(),             "http");
00077                 ensure_equals("authority",      u.authority(),  "abc.com");
00078                 ensure_equals("path",           u.path(),               "/def/ghi");
00079                 ensure_equals("query",          u.query(),              "x=37&y=hello");
00080 
00081                 ensure_equals("host name", u.hostName(), "abc.com");
00082                 ensure_equals("host port", u.hostPort(), 80);
00083 
00084                 LLSD query = u.queryMap();
00085                 ensure_equals("query x", query["x"].asInteger(), 37);
00086                 ensure_equals("query y", query["y"].asString(), "hello");
00087 
00088                 query = LLURI::queryMap("x=22.23&y=https://lindenlab.com/");
00089                 ensure_equals("query x", query["x"].asReal(), 22.23);
00090                 ensure_equals("query y", query["y"].asURI().asString(), "https://lindenlab.com/");
00091         }
00092 
00093         template<> template<>
00094         void URITestObject::test<2>()
00095         {
00096                 // empty string
00097                 checkParts(LLURI(""), "", "", "", "");
00098         }
00099         
00100         template<> template<>
00101         void URITestObject::test<3>()
00102         {
00103                 // no scheme
00104                 checkParts(LLURI("foo"), "", "foo", "", "");
00105                 checkParts(LLURI("foo%3A"), "", "foo:", "", "");
00106         }
00107 
00108         template<> template<>
00109         void URITestObject::test<4>()
00110         {
00111                 // scheme w/o paths
00112                 checkParts(LLURI("mailto:zero@ll.com"),
00113                         "mailto", "zero@ll.com", "", "");
00114                 checkParts(LLURI("silly://abc/def?foo"),
00115                         "silly", "//abc/def?foo", "", "");
00116         }
00117 
00118         template<> template<>
00119         void URITestObject::test<5>()
00120         {
00121                 // authority section
00122                 checkParts(LLURI("http:///"),
00123                         "http", "///", "", "/");
00124                         
00125                 checkParts(LLURI("http://abc"),
00126                         "http", "//abc", "abc", "");
00127                         
00128                 checkParts(LLURI("http://a%2Fb/cd"),
00129                         "http", "//a/b/cd", "a/b", "/cd");
00130                         
00131                 checkParts(LLURI("http://host?"),
00132                         "http", "//host?", "host", "");
00133         }
00134 
00135         template<> template<>
00136         void URITestObject::test<6>()
00137         {               
00138                 // path section
00139                 checkParts(LLURI("http://host/a/b/"),
00140                                 "http", "//host/a/b/", "host", "/a/b/");
00141                                 
00142                 checkParts(LLURI("http://host/a%3Fb/"),
00143                                 "http", "//host/a?b/", "host", "/a?b/");
00144                                 
00145                 checkParts(LLURI("http://host/a:b/"),
00146                                 "http", "//host/a:b/", "host", "/a:b/");
00147         }
00148 
00149         template<> template<>
00150         void URITestObject::test<7>()
00151         {               
00152                 // query string
00153                 checkParts(LLURI("http://host/?"),
00154                                 "http", "//host/?", "host", "/", "");
00155                                 
00156                 checkParts(LLURI("http://host/?x"),
00157                                 "http", "//host/?x", "host", "/", "x");
00158                                 
00159                 checkParts(LLURI("http://host/??"),
00160                                 "http", "//host/??", "host", "/", "?");
00161                                 
00162                 checkParts(LLURI("http://host/?%3F"),
00163                                 "http", "//host/??", "host", "/", "?");
00164         }
00165 
00166         template<> template<>
00167         void URITestObject::test<8>()
00168         {
00169                 LLSD path;
00170                 path.append("x");
00171                 path.append("123");
00172                 checkParts(LLURI::buildHTTP("host", path),
00173                         "http", "//host/x/123", "host", "/x/123");
00174                 
00175                 LLSD query;
00176                 query["123"] = "12";
00177                 query["abcd"] = "abc";
00178                 checkParts(LLURI::buildHTTP("host", path, query),
00179                         "http", "//host/x/123?123=12&abcd=abc",
00180                         "host", "/x/123", "123=12&abcd=abc");
00181         }
00182 
00183         template<> template<>
00184         void URITestObject::test<9>()
00185         {
00186                 // test unescaped path components
00187                 LLSD path;
00188                 path.append("x@*//*$&^");
00189                 path.append("123");
00190                 checkParts(LLURI::buildHTTP("host", path),
00191                         "http", "//host/x@*//*$&^/123", "host", "/x@*//*$&^/123");
00192         }
00193 
00194         template<> template<>
00195         void URITestObject::test<10>()
00196         {
00197                 // test unescaped query components
00198                 LLSD path;
00199                 path.append("x");
00200                 path.append("123");
00201                 LLSD query;
00202                 query["123"] = "?&*#//";
00203                 query["**@&?//"] = "abc";
00204                 checkParts(LLURI::buildHTTP("host", path, query),
00205                         "http", "//host/x/123?**@&?//=abc&123=?&*#//",
00206                         "host", "/x/123", "**@&?//=abc&123=?&*#//");
00207         }
00208 
00209         template<> template<>
00210         void URITestObject::test<11>()
00211         {
00212                 // test unescaped host components
00213                 LLSD path;
00214                 path.append("x");
00215                 path.append("123");
00216                 LLSD query;
00217                 query["123"] = "12";
00218                 query["abcd"] = "abc";
00219                 checkParts(LLURI::buildHTTP("hi123*33--}{:portstuffs", path, query),
00220                         "http", "//hi123*33--}{:portstuffs/x/123?123=12&abcd=abc",
00221                         "hi123*33--}{:portstuffs", "/x/123", "123=12&abcd=abc");
00222         }
00223         
00224         template<> template<>
00225         void URITestObject::test<12>()
00226         {
00227                 // test funky host_port values that are actually prefixes
00228                 
00229                 checkParts(LLURI::buildHTTP("http://example.com:8080", LLSD()),
00230                         "http", "//example.com:8080",
00231                         "example.com:8080", "");
00232                         
00233                 checkParts(LLURI::buildHTTP("http://example.com:8080/", LLSD()),
00234                         "http", "//example.com:8080/",
00235                         "example.com:8080", "/");
00236 
00237                 checkParts(LLURI::buildHTTP("http://example.com:8080/a/b", LLSD()),
00238                         "http", "//example.com:8080/a/b",
00239                         "example.com:8080", "/a/b");
00240         }
00241 
00242         template<> template<>
00243         void URITestObject::test<13>()
00244         {
00245                 const std::string unreserved =   
00246                         "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
00247                         "0123456789"
00248                         "-._~";
00249                 // test escape
00250                 ensure_equals("escaping", LLURI::escape("abcdefg", "abcdef"), "abcdef%67");
00251                 ensure_equals("escaping", LLURI::escape("|/&\\+-_!@", ""), "%7C%2F%26%5C%2B%2D%5F%21%40");
00252                 ensure_equals("escaping as query variable", 
00253                                           LLURI::escape("http://10.0.1.4:12032/agent/god/agent-id/map/layer/?resume=http://station3.ll.com:12032/agent/203ad6df-b522-491d-ba48-4e24eb57aeff/send-postcard", unreserved + ":@!$'()*+,="), 
00254                                           "http:%2F%2F10.0.1.4:12032%2Fagent%2Fgod%2Fagent-id%2Fmap%2Flayer%2F%3Fresume=http:%2F%2Fstation3.ll.com:12032%2Fagent%2F203ad6df-b522-491d-ba48-4e24eb57aeff%2Fsend-postcard");
00255                 // French cedilla (C with squiggle, like in the word Francais) is UTF-8 C3 A7
00256                 std::string cedilla;
00257                 cedilla.push_back( (char)0xC3 );
00258                 cedilla.push_back( (char)0xA7 );
00259                 ensure_equals("escape UTF8", LLURI::escape( cedilla, unreserved), "%C3%A7");
00260         }
00261         
00262 
00263         template<> template<>
00264         void URITestObject::test<14>()
00265         {
00266                 // make sure escape and unescape of empty strings return empty
00267                 // strings.
00268                 std::string uri_esc(LLURI::escape(""));
00269                 ensure("escape string empty", uri_esc.empty());
00270                 std::string uri_raw(LLURI::unescape(""));
00271                 ensure("unescape string empty", uri_raw.empty());
00272         }
00273 
00274         template<> template<>
00275         void URITestObject::test<15>()
00276         {
00277                 // do some round-trip tests
00278                 escapeRoundTrip("http://secondlife.com");
00279                 escapeRoundTrip("http://secondlife.com/url with spaces");
00280                 escapeRoundTrip("http://bad[domain]name.com/");
00281                 escapeRoundTrip("ftp://bill.gates@ms/micro$oft.com/c:\\autoexec.bat");
00282                 escapeRoundTrip("");
00283         }
00284 
00285         template<> template<>
00286         void URITestObject::test<16>()
00287         {
00288                 // Test the default escaping
00289                 std::string simple("http://secondlife.com");
00290                 ensure_equals("simple http", LLURI::escape(simple), simple);
00291                 std::string longer("http://secondlife.com:8888/simple.php?foo=bar&q=1");
00292                 ensure_equals("more http", LLURI::escape(longer), longer);
00293                 ensure_equals(
00294                         "needs escape",
00295                         LLURI::escape("http://get.secondlife.com/windows viewer"),
00296                         "http://get.secondlife.com/windows%20viewer");
00297         }
00298 
00299         template<> template<>
00300         void URITestObject::test<17>()
00301         {
00302                 // do some round-trip tests with very long strings.
00303                 escapeRoundTrip("Welcome to Second Life.We hope you'll have a richly rewarding experience, filled with creativity, self expression and fun.The goals of the Community Standards are simple: treat each other with respect and without harassment, adhere to local standards as indicated by simulator ratings, and refrain from any hate activity which slurs a real-world individual or real-world community. Behavioral Guidelines - The Big Six");
00304                 escapeRoundTrip(
00305                         "'asset_data':b(12100){'task_id':ucc706f2d-0b68-68f8-11a4-f1043ff35ca0}\n{\n\tname\tObject|\n\tpermissions 0\n\t{\n\t\tbase_mask\t7fffffff\n\t\towner_mask\t7fffffff\n\t\tgroup_mask\t00000000\n\t\teveryone_mask\t00000000\n\t\tnext_owner_mask\t7fffffff\n\t\tcreator_id\t13fd9595-a47b-4d64-a5fb-6da645f038e0\n\t\towner_id\t3c115e51-04f4-523c-9fa6-98aff1034730\n\t\tlast_owner_id\t3c115e51-04f4-523c-9fa6-98aff1034730\n\t\tgroup_id\t00000000-0000-0000-0000-000000000000\n\t}\n\tlocal_id\t217444921\n\ttotal_crc\t323\n\ttype\t2\n\ttask_valid\t2\n\ttravel_access\t13\n\tdisplayopts\t2\n\tdisplaytype\tv\n\tpos\t-0.368634403\t0.00781063363\t-0.569040775\n\toldpos\t150.117996\t25.8658009\t8.19664001\n\trotation\t-0.06293071806430816650390625\t-0.6995697021484375\t-0.7002241611480712890625\t0.1277817934751510620117188\n\tchildpos\t-0.00499999989\t-0.0359999985\t0.307999998\n\tchildrot\t-0.515492737293243408203125\t-0.46601200103759765625\t0.529055416584014892578125\t0.4870323240756988525390625\n\tscale"
00306                         "\t0.074629\t0.289956\t0.01\n\tsit_offset\t0\t0\t0\n\tcamera_eye_offset\t0\t0\t0\n\tcamera_at_offset\t0\t0\t0\n\tsit_quat\t0\t0\t0\t1\n\tsit_hint\t0\n\tstate\t160\n\tmaterial\t3\n\tsoundid\t00000000-0000-0000-0000-000000000000\n\tsoundgain\t0\n\tsoundradius\t0\n\tsoundflags\t0\n\ttextcolor\t0 0 0 1\n\tselected\t0\n\tselector\t00000000-0000-0000-0000-000000000000\n\tusephysics\t0\n\trotate_x\t1\n\trotate_y\t1\n\trotate_z\t1\n\tphantom\t0\n\tremote_script_access_pin\t0\n\tvolume_detect\t0\n\tblock_grabs\t0\n\tdie_at_edge\t0\n\treturn_at_edge\t0\n\ttemporary\t0\n\tsandbox\t0\n\tsandboxhome\t0\t0\t0\n\tshape 0\n\t{\n\t\tpath 0\n\t\t{\n\t\t\tcurve\t16\n\t\t\tbegin\t0\n\t\t\tend\t1\n\t\t\tscale_x\t1\n\t\t\tscale_y\t1\n\t\t\tshear_x\t0\n\t\t\tshear_y\t0\n\t\t\ttwist\t0\n\t\t\ttwist_begin\t0\n\t\t\tradius_offset\t0\n\t\t\ttaper_x\t0\n\t\t\ttaper_y\t0\n\t\t\trevolutions\t1\n\t\t\tskew\t0\n\t\t}\n\t\tprofile 0\n\t\t{\n\t\t\tcurve\t1\n\t\t\tbegin\t0\n\t\t\tend\t1\n\t\t\thollow\t0\n\t\t}\n\t}\n\tf"
00307                         "aces\t6\n\t{\n\t\timageid\tddde1ffc-678b-3cda-1748-513086bdf01b\n\t\tcolors\t0.937255 0.796078 0.494118 1\n\t\tscales\t1\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t0\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\t{\n\t\timageid\tf54a0c32-3cd1-d49a-5b4f-7b792bebc204\n\t\tcolors\t0.937255 0.796078 0.494118 1\n\t\tscales\t1\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t0\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\t{\n\t\timageid\tf54a0c32-3cd1-d49a-5b4f-7b792bebc204\n\t\tcolors\t0.937255 0.796078 0.494118 1\n\t\tscales\t1\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t0\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\t{\n\t\timageid\tf54a0c32-3cd1-d49a-5b4f-7b792bebc204\n\t\tcolors\t0.937255 0.796078 0.494118 1\n\t\tscales\t1\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t0\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\t{\n\t\timageid\tf54a0c32-3cd1-d49a-5b4f-7b792bebc204"
00308                         "\n\t\tcolors\t0.937255 0.796078 0.494118 1\n\t\tscales\t1\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t0\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\t{\n\t\timageid\tddde1ffc-678b-3cda-1748-513086bdf01b\n\t\tcolors\t0.937255 0.796078 0.494118 1\n\t\tscales\t1\n\t\tscalet\t-1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t0\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\tps_next_crc\t1\n\tgpw_bias\t1\n\tip\t0\n\tcomplete\tTRUE\n\tdelay\t50000\n\tnextstart\t0\n\tbirthtime\t1061088050622956\n\treztime\t1094866329019785\n\tparceltime\t1133568981980596\n\ttax_rate\t1.00084\n\tscratchpad\t0\n\t{\n\t\n\t}\n\tsale_info\t0\n\t{\n\t\tsale_type\tnot\n\t\tsale_price\t10\n\t}\n\tcorrect_family_id\t00000000-0000-0000-0000-000000000000\n\thas_rezzed\t0\n\tpre_link_base_mask\t7fffffff\n\tlinked \tchild\n\tdefault_pay_price\t-2\t1\t5\t10\t20\n}\n{'task_id':u61fa7364-e151-0597-774c-523312dae31b}\n{\n\tname\tObject|\n\tpermissions 0\n\t{\n\t\tbase_mask\t7fffff"
00309                         "ff\n\t\towner_mask\t7fffffff\n\t\tgroup_mask\t00000000\n\t\teveryone_mask\t00000000\n\t\tnext_owner_mask\t7fffffff\n\t\tcreator_id\t13fd9595-a47b-4d64-a5fb-6da645f038e0\n\t\towner_id\t3c115e51-04f4-523c-9fa6-98aff1034730\n\t\tlast_owner_id\t3c115e51-04f4-523c-9fa6-98aff1034730\n\t\tgroup_id\t00000000-0000-0000-0000-000000000000\n\t}\n\tlocal_id\t217444922\n\ttotal_crc\t324\n\ttype\t2\n\ttask_valid\t2\n\ttravel_access\t13\n\tdisplayopts\t2\n\tdisplaytype\tv\n\tpos\t-0.367110789\t0.00780026987\t-0.566269755\n\toldpos\t150.115005\t25.8479004\t8.18669987\n\trotation\t0.47332942485809326171875\t-0.380102097988128662109375\t-0.5734078884124755859375\t0.550168216228485107421875\n\tchildpos\t-0.00499999989\t-0.0370000005\t0.305000007\n\tchildrot\t-0.736649334430694580078125\t-0.03042060509324073791503906\t-0.02784589119255542755126953\t0.67501628398895263671875\n\tscale\t0.074629\t0.289956\t0.01\n\tsit_offset\t0\t0\t0\n\tcamera_eye_offset\t0\t0\t0\n\tcamera_at_offset\t0\t0\t0\n\tsit_quat\t0\t"
00310                         "0\t0\t1\n\tsit_hint\t0\n\tstate\t160\n\tmaterial\t3\n\tsoundid\t00000000-0000-0000-0000-000000000000\n\tsoundgain\t0\n\tsoundradius\t0\n\tsoundflags\t0\n\ttextcolor\t0 0 0 1\n\tselected\t0\n\tselector\t00000000-0000-0000-0000-000000000000\n\tusephysics\t0\n\trotate_x\t1\n\trotate_y\t1\n\trotate_z\t1\n\tphantom\t0\n\tremote_script_access_pin\t0\n\tvolume_detect\t0\n\tblock_grabs\t0\n\tdie_at_edge\t0\n\treturn_at_edge\t0\n\ttemporary\t0\n\tsandbox\t0\n\tsandboxhome\t0\t0\t0\n\tshape 0\n\t{\n\t\tpath 0\n\t\t{\n\t\t\tcurve\t16\n\t\t\tbegin\t0\n\t\t\tend\t1\n\t\t\tscale_x\t1\n\t\t\tscale_y\t1\n\t\t\tshear_x\t0\n\t\t\tshear_y\t0\n\t\t\ttwist\t0\n\t\t\ttwist_begin\t0\n\t\t\tradius_offset\t0\n\t\t\ttaper_x\t0\n\t\t\ttaper_y\t0\n\t\t\trevolutions\t1\n\t\t\tskew\t0\n\t\t}\n\t\tprofile 0\n\t\t{\n\t\t\tcurve\t1\n\t\t\tbegin\t0\n\t\t\tend\t1\n\t\t\thollow\t0\n\t\t}\n\t}\n\tfaces\t6\n\t{\n\t\timageid\tddde1ffc-678b-3cda-1748-513086bdf01b\n\t\tcolors\t0.937255 0.796078 0.494118 1\n\t\tscales\t1\n\t"
00311                         "\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t0\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\t{\n\t\timageid\tf54a0c32-3cd1-d49a-5b4f-7b792bebc204\n\t\tcolors\t0.937255 0.796078 0.494118 1\n\t\tscales\t1\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t0\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\t{\n\t\timageid\tf54a0c32-3cd1-d49a-5b4f-7b792bebc204\n\t\tcolors\t0.937255 0.796078 0.494118 1\n\t\tscales\t1\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t0\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\t{\n\t\timageid\tf54a0c32-3cd1-d49a-5b4f-7b792bebc204\n\t\tcolors\t0.937255 0.796078 0.494118 1\n\t\tscales\t1\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t0\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\t{\n\t\timageid\tf54a0c32-3cd1-d49a-5b4f-7b792bebc204\n\t\tcolors\t0.937255 0.796078 0.494118 1\n\t\tscales\t1\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t0\n\t"
00312                         "\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\t{\n\t\timageid\tddde1ffc-678b-3cda-1748-513086bdf01b\n\t\tcolors\t0.937255 0.796078 0.494118 1\n\t\tscales\t1\n\t\tscalet\t-1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t0\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\tps_next_crc\t1\n\tgpw_bias\t1\n\tip\t0\n\tcomplete\tTRUE\n\tdelay\t50000\n\tnextstart\t0\n\tbirthtime\t1061087839248891\n\treztime\t1094866329020800\n\tparceltime\t1133568981981983\n\ttax_rate\t1.00084\n\tscratchpad\t0\n\t{\n\t\n\t}\n\tsale_info\t0\n\t{\n\t\tsale_type\tnot\n\t\tsale_price\t10\n\t}\n\tcorrect_family_id\t00000000-0000-0000-0000-000000000000\n\thas_rezzed\t0\n\tpre_link_base_mask\t7fffffff\n\tlinked \tchild\n\tdefault_pay_price\t-2\t1\t5\t10\t20\n}\n{'task_id':ub8d68643-7dd8-57af-0d24-8790032aed0c}\n{\n\tname\tObject|\n\tpermissions 0\n\t{\n\t\tbase_mask\t7fffffff\n\t\towner_mask\t7fffffff\n\t\tgroup_mask\t00000000\n\t\teveryone_mask\t00000000\n\t\tnext_owner_mask\t7fffffff\n\t\tcreat"
00313                         "or_id\t13fd9595-a47b-4d64-a5fb-6da645f038e0\n\t\towner_id\t3c115e51-04f4-523c-9fa6-98aff1034730\n\t\tlast_owner_id\t3c115e51-04f4-523c-9fa6-98aff1034730\n\t\tgroup_id\t00000000-0000-0000-0000-000000000000\n\t}\n\tlocal_id\t217444923\n\ttotal_crc\t235\n\ttype\t2\n\ttask_valid\t2\n\ttravel_access\t13\n\tdisplayopts\t2\n\tdisplaytype\tv\n\tpos\t-0.120029509\t-0.00284469454\t-0.0302077383\n\toldpos\t150.710999\t25.8584995\t8.19172001\n\trotation\t0.145459949970245361328125\t-0.1646589934825897216796875\t0.659558117389678955078125\t-0.718826770782470703125\n\tchildpos\t0\t-0.182999998\t-0.26699999\n\tchildrot\t0.991444766521453857421875\t3.271923924330621957778931e-05\t-0.0002416197530692443251609802\t0.1305266767740249633789062\n\tscale\t0.0382982\t0.205957\t0.368276\n\tsit_offset\t0\t0\t0\n\tcamera_eye_offset\t0\t0\t0\n\tcamera_at_offset\t0\t0\t0\n\tsit_quat\t0\t0\t0\t1\n\tsit_hint\t0\n\tstate\t160\n\tmaterial\t3\n\tsoundid\t00000000-0000-0000-0000-000000000000\n\tsoundgain\t0\n\tsoundra"
00314                         "dius\t0\n\tsoundflags\t0\n\ttextcolor\t0 0 0 1\n\tselected\t0\n\tselector\t00000000-0000-0000-0000-000000000000\n\tusephysics\t0\n\trotate_x\t1\n\trotate_y\t1\n\trotate_z\t1\n\tphantom\t0\n\tremote_script_access_pin\t0\n\tvolume_detect\t0\n\tblock_grabs\t0\n\tdie_at_edge\t0\n\treturn_at_edge\t0\n\ttemporary\t0\n\tsandbox\t0\n\tsandboxhome\t0\t0\t0\n\tshape 0\n\t{\n\t\tpath 0\n\t\t{\n\t\t\tcurve\t32\n\t\t\tbegin\t0.3\n\t\t\tend\t0.65\n\t\t\tscale_x\t1\n\t\t\tscale_y\t0.05\n\t\t\tshear_x\t0\n\t\t\tshear_y\t0\n\t\t\ttwist\t0\n\t\t\ttwist_begin\t0\n\t\t\tradius_offset\t0\n\t\t\ttaper_x\t0\n\t\t\ttaper_y\t0\n\t\t\trevolutions\t1\n\t\t\tskew\t0\n\t\t}\n\t\tprofile 0\n\t\t{\n\t\t\tcurve\t0\n\t\t\tbegin\t0\n\t\t\tend\t1\n\t\t\thollow\t0\n\t\t}\n\t}\n\tfaces\t3\n\t{\n\t\timageid\te7150bed-3e3e-c698-eb15-d17b178148af\n\t\tcolors\t0.843137 0.156863 0.156863 1\n\t\tscales\t15\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t-1.57084\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0"
00315                         "\n\t}\n\t{\n\t\timageid\te7150bed-3e3e-c698-eb15-d17b178148af\n\t\tcolors\t0.843137 0.156863 0.156863 1\n\t\tscales\t15\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t-1.57084\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\t{\n\t\timageid\te7150bed-3e3e-c698-eb15-d17b178148af\n\t\tcolors\t0.843137 0.156863 0.156863 1\n\t\tscales\t15\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t-1.57084\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\tps_next_crc\t1\n\tgpw_bias\t1\n\tip\t0\n\tcomplete\tTRUE\n\tdelay\t50000\n\tnextstart\t0\n\tbirthtime\t1061087534454174\n\treztime\t1094866329021741\n\tparceltime\t1133568981982889\n\ttax_rate\t1.00326\n\tscratchpad\t0\n\t{\n\t\n\t}\n\tsale_info\t0\n\t{\n\t\tsale_type\tnot\n\t\tsale_price\t10\n\t}\n\tcorrect_family_id\t00000000-0000-0000-0000-000000000000\n\thas_rezzed\t0\n\tpre_link_base_mask\t7fffffff\n\tlinked \tchild\n\tdefault_pay_price\t-2\t1\t5\t10\t20\n}\n{'task_id':ue4b19200-9d33-962f-c8c5-6f"
00316                         "25be3a3fd0}\n{\n\tname\tApotheosis_Immolaine_tail|\n\tpermissions 0\n\t{\n\t\tbase_mask\t7fffffff\n\t\towner_mask\t7fffffff\n\t\tgroup_mask\t00000000\n\t\teveryone_mask\t00000000\n\t\tnext_owner_mask\t7fffffff\n\t\tcreator_id\t13fd9595-a47b-4d64-a5fb-6da645f038e0\n\t\towner_id\t3c115e51-04f4-523c-9fa6-98aff1034730\n\t\tlast_owner_id\t3c115e51-04f4-523c-9fa6-98aff1034730\n\t\tgroup_id\t00000000-0000-0000-0000-000000000000\n\t}\n\tlocal_id\t217444924\n\ttotal_crc\t675\n\ttype\t1\n\ttask_valid\t2\n\ttravel_access\t13\n\tdisplayopts\t2\n\tdisplaytype\tv\n\tpos\t-0.34780401\t-0.00968400016\t-0.260098994\n\toldpos\t0\t0\t0\n\trotation\t0.73164522647857666015625\t-0.67541944980621337890625\t-0.07733880728483200073242188\t0.05022468417882919311523438\n\tvelocity\t0\t0\t0\n\tangvel\t0\t0\t0\n\tscale\t0.0382982\t0.32228\t0.383834\n\tsit_offset\t0\t0\t0\n\tcamera_eye_offset\t0\t0\t0\n\tcamera_at_offset\t0\t0\t0\n\tsit_quat\t0\t0\t0\t1\n\tsit_hint\t0\n\tstate\t160\n\tmaterial\t3\n\tsoundid\t00000"
00317                         "000-0000-0000-0000-000000000000\n\tsoundgain\t0\n\tsoundradius\t0\n\tsoundflags\t0\n\ttextcolor\t0 0 0 1\n\tselected\t0\n\tselector\t00000000-0000-0000-0000-000000000000\n\tusephysics\t0\n\trotate_x\t1\n\trotate_y\t1\n\trotate_z\t1\n\tphantom\t0\n\tremote_script_access_pin\t0\n\tvolume_detect\t0\n\tblock_grabs\t0\n\tdie_at_edge\t0\n\treturn_at_edge\t0\n\ttemporary\t0\n\tsandbox\t0\n\tsandboxhome\t0\t0\t0\n\tshape 0\n\t{\n\t\tpath 0\n\t\t{\n\t\t\tcurve\t32\n\t\t\tbegin\t0.3\n\t\t\tend\t0.65\n\t\t\tscale_x\t1\n\t\t\tscale_y\t0.05\n\t\t\tshear_x\t0\n\t\t\tshear_y\t0\n\t\t\ttwist\t0\n\t\t\ttwist_begin\t0\n\t\t\tradius_offset\t0\n\t\t\ttaper_x\t0\n\t\t\ttaper_y\t0\n\t\t\trevolutions\t1\n\t\t\tskew\t0\n\t\t}\n\t\tprofile 0\n\t\t{\n\t\t\tcurve\t0\n\t\t\tbegin\t0\n\t\t\tend\t1\n\t\t\thollow\t0\n\t\t}\n\t}\n\tfaces\t3\n\t{\n\t\timageid\te7150bed-3e3e-c698-eb15-d17b178148af\n\t\tcolors\t0.843137 0.156863 0.156863 1\n\t\tscales\t15\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t-1"
00318                         ".57084\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\t{\n\t\timageid\te7150bed-3e3e-c698-eb15-d17b178148af\n\t\tcolors\t0.843137 0.156863 0.156863 1\n\t\tscales\t15\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t-1.57084\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\t{\n\t\timageid\te7150bed-3e3e-c698-eb15-d17b178148af\n\t\tcolors\t0.843137 0.156863 0.156863 1\n\t\tscales\t15\n\t\tscalet\t1\n\t\toffsets\t0\n\t\toffsett\t0\n\t\timagerot\t-1.57084\n\t\tbump\t0\n\t\tfullbright\t0\n\t\tmedia_flags\t0\n\t}\n\tps_next_crc\t1\n\tgpw_bias\t1\n\tip\t0\n\tcomplete\tTRUE\n\tdelay\t50000\n\tnextstart\t0\n\tbirthtime\t1061087463950186\n\treztime\t1094866329022555\n\tparceltime\t1133568981984359\n\tdescription\t(No Description)|\n\ttax_rate\t1.01736\n\tnamevalue\tAttachPt U32 RW S 10\n\tnamevalue\tAttachmentOrientation VEC3 RW DS -3.110088, -0.182018, 1.493795\n\tnamevalue\tAttachmentOffset VEC3 RW DS -0.347804, -0.009684, -0.260099\n\tnamevalue\tAttachItemI"
00319                         "D STRING RW SV 20f36c3a-b44b-9bc7-87f3-018bfdfc8cda\n\tscratchpad\t0\n\t{\n\t\n\t}\n\tsale_info\t0\n\t{\n\t\tsale_type\tnot\n\t\tsale_price\t10\n\t}\n\torig_asset_id\t8747acbc-d391-1e59-69f1-41d06830e6c0\n\torig_item_id\t20f36c3a-b44b-9bc7-87f3-018bfdfc8cda\n\tfrom_task_id\t3c115e51-04f4-523c-9fa6-98aff1034730\n\tcorrect_family_id\t00000000-0000-0000-0000-000000000000\n\thas_rezzed\t0\n\tpre_link_base_mask\t7fffffff\n\tlinked \tlinked\n\tdefault_pay_price\t-2\t1\t5\t10\t20\n}\n");
00320         }
00321 
00322          
00323         template<> template<>
00324         void URITestObject::test<18>()
00325         {
00326                 LLURI u("secondlife:///app/login?first_name=Testert4&last_name=Tester&web_login_key=test");
00327                 // if secondlife is the scheme, LLURI should parse /app/login as path, with no authority 
00328                 ensure_equals("scheme",         u.scheme(),             "secondlife");
00329                 ensure_equals("authority",      u.authority(),  "");
00330                 ensure_equals("path",           u.path(),               "/app/login");
00331                 ensure_equals("pathmap",        u.pathArray()[0].asString(),    "app");
00332                 ensure_equals("pathmap",        u.pathArray()[1].asString(),    "login");
00333                 ensure_equals("query",          u.query(),              "first_name=Testert4&last_name=Tester&web_login_key=test");
00334                 ensure_equals("query map element", u.queryMap()["last_name"].asString(), "Tester");
00335                 
00336                 u = LLURI("secondlife://Da Boom/128/128/128");
00337                 // if secondlife is the scheme, LLURI should parse /128/128/128 as path, with Da Boom as authority
00338                 ensure_equals("scheme",         u.scheme(),             "secondlife");
00339                 ensure_equals("authority",      u.authority(),  "Da Boom");
00340                 ensure_equals("path",           u.path(),               "/128/128/128");
00341                 ensure_equals("pathmap",        u.pathArray()[0].asString(),    "128");
00342                 ensure_equals("pathmap",        u.pathArray()[1].asString(),    "128");
00343                 ensure_equals("pathmap",        u.pathArray()[2].asString(),    "128");
00344                 ensure_equals("query",          u.query(),              "");
00345         }
00346 
00347         template<> template<>
00348         void URITestObject::test<19>()
00349         {
00350                 // Parse about: schemes
00351                 LLURI u("about:blank?redirect-http-hack=secondlife%3A%2F%2F%2Fapp%2Flogin%3Ffirst_name%3DCallum%26last_name%3DLinden%26location%3Dspecify%26grid%3Dvaak%26region%3D%2FMorris%2F128%2F128%26web_login_key%3Defaa4795-c2aa-4c58-8966-763c27931e78");
00352                 ensure_equals("scheme",         u.scheme(),             "about");
00353                 ensure_equals("authority",      u.authority(),  "");
00354                 ensure_equals("path",           u.path(),               "blank");
00355                 ensure_equals("pathmap",        u.pathArray()[0].asString(),    "blank");
00356                 ensure_equals("query",          u.query(),              "redirect-http-hack=secondlife:///app/login?first_name=Callum&last_name=Linden&location=specify&grid=vaak&region=/Morris/128/128&web_login_key=efaa4795-c2aa-4c58-8966-763c27931e78");
00357                 ensure_equals("query map element", u.queryMap()["redirect-http-hack"].asString(), "secondlife:///app/login?first_name=Callum&last_name=Linden&location=specify&grid=vaak&region=/Morris/128/128&web_login_key=efaa4795-c2aa-4c58-8966-763c27931e78");
00358         }
00359 }
00360 
00361 

Generated on Fri May 16 08:34:31 2008 for SecondLife by  doxygen 1.5.5