aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/test
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:46 -0500
committerJacek Antonelli2008-08-15 23:44:46 -0500
commit38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch)
treeadca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/test
parentREADME.txt (diff)
downloadmeta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz
Second Life viewer sources 1.13.2.12
Diffstat (limited to '')
-rw-r--r--linden/indra/test/MacTester.xcodeproj/project.pbxproj1326
-rw-r--r--linden/indra/test/common.cpp447
-rw-r--r--linden/indra/test/files.lst18
-rw-r--r--linden/indra/test/inventory.cpp167
-rw-r--r--linden/indra/test/io.cpp1387
-rw-r--r--linden/indra/test/llapp_tut.cpp153
-rw-r--r--linden/indra/test/llhttpclient_tut.cpp315
-rw-r--r--linden/indra/test/llhttpnode_tut.cpp428
-rw-r--r--linden/indra/test/lliohttpserver_tut.cpp303
-rw-r--r--linden/indra/test/llmime_tut.cpp443
-rw-r--r--linden/indra/test/llpipeutil.cpp158
-rw-r--r--linden/indra/test/llpipeutil.h144
-rw-r--r--linden/indra/test/llsd_message_system_tut.cpp142
-rw-r--r--linden/indra/test/llsd_new_tut.cpp840
-rw-r--r--linden/indra/test/llsdserialize_tut.cpp558
-rw-r--r--linden/indra/test/lltiming_tut.cpp112
-rw-r--r--linden/indra/test/lltut.cpp168
-rw-r--r--linden/indra/test/lltut.h95
-rw-r--r--linden/indra/test/lluri_tut.cpp221
-rw-r--r--linden/indra/test/lluserrelations_tut.cpp157
-rw-r--r--linden/indra/test/math.cpp133
-rw-r--r--linden/indra/test/reflection_tut.cpp223
-rw-r--r--linden/indra/test/test.cpp267
-rw-r--r--linden/indra/test/test.vcproj244
24 files changed, 8449 insertions, 0 deletions
diff --git a/linden/indra/test/MacTester.xcodeproj/project.pbxproj b/linden/indra/test/MacTester.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..77ba7c2
--- /dev/null
+++ b/linden/indra/test/MacTester.xcodeproj/project.pbxproj
@@ -0,0 +1,1326 @@
1// !$*UTF8*$!
2{
3 archiveVersion = 1;
4 classes = {
5 };
6 objectVersion = 42;
7 objects = {
8
9/* Begin PBXAggregateTarget section */
10 FD5DF9A109C0A4F5007E3F78 /* third party libs */ = {
11 isa = PBXAggregateTarget;
12 buildConfigurationList = FD5DF9A209C0A51D007E3F78 /* Build configuration list for PBXAggregateTarget "third party libs" */;
13 buildPhases = (
14 FD5DF9A009C0A4F5007E3F78 /* ShellScript */,
15 );
16 dependencies = (
17 );
18 name = "third party libs";
19 productName = "third party libs";
20 };
21/* End PBXAggregateTarget section */
22
23/* Begin PBXBuildFile section */
24 386C3F070A14C85000CF4511 /* lliosocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386C3F050A14C85000CF4511 /* lliosocket.cpp */; };
25 386C3F080A14C85000CF4511 /* lliosocket.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 386C3F060A14C85000CF4511 /* lliosocket.h */; };
26 389CFB460A0B69C700EE2094 /* llfile.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 389CFB440A0B69C700EE2094 /* llfile.h */; };
27 389CFB470A0B69C700EE2094 /* llfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 389CFB450A0B69C700EE2094 /* llfile.cpp */; };
28 38A8BEAB0A18A2BC00814862 /* metaclass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38A8BEAA0A18A2BC00814862 /* metaclass.cpp */; };
29 38A8BF630A18C31D00814862 /* metaproperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38A8BF620A18C31D00814862 /* metaproperty.cpp */; };
30 38A8BF6A0A18C38800814862 /* reflective.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 38A8BF690A18C38800814862 /* reflective.h */; };
31 38A8BF750A18C42900814862 /* reflective.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38A8BF740A18C42900814862 /* reflective.cpp */; };
32 91469E810B4486F20009E8F9 /* llmime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91469E7F0B4486F20009E8F9 /* llmime.cpp */; };
33 91469E820B4486F20009E8F9 /* llmime.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 91469E800B4486F20009E8F9 /* llmime.h */; };
34 91469E840B44870B0009E8F9 /* llmime_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91469E830B44870B0009E8F9 /* llmime_tut.cpp */; };
35 91469E8D0B4489420009E8F9 /* llquaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91469E8B0B4489420009E8F9 /* llquaternion.cpp */; };
36 91469E8E0B4489420009E8F9 /* llquaternion.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 91469E8C0B4489420009E8F9 /* llquaternion.h */; };
37 DA306B450ACD9E8B008D9B2F /* llsdutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B430ACD9E8B008D9B2F /* llsdutil.cpp */; };
38 DA306B460ACD9E8B008D9B2F /* llstreamtools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B440ACD9E8B008D9B2F /* llstreamtools.cpp */; };
39 DA306B490ACD9EBC008D9B2F /* llapp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B480ACD9EBC008D9B2F /* llapp.cpp */; };
40 DA306B4E0ACD9EFD008D9B2F /* llcommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B4B0ACD9EFD008D9B2F /* llcommon.cpp */; };
41 DA306B4F0ACD9EFD008D9B2F /* llerrorthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B4C0ACD9EFD008D9B2F /* llerrorthread.cpp */; };
42 DA306B500ACD9EFD008D9B2F /* llrun.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B4D0ACD9EFD008D9B2F /* llrun.cpp */; };
43 DA306B560ACD9F3F008D9B2F /* llapp_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B520ACD9F3F008D9B2F /* llapp_tut.cpp */; };
44 DA306B570ACD9F3F008D9B2F /* llhttpclient_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B530ACD9F3F008D9B2F /* llhttpclient_tut.cpp */; };
45 DA306B580ACD9F3F008D9B2F /* lltiming_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B540ACD9F3F008D9B2F /* lltiming_tut.cpp */; };
46 DA306B590ACD9F3F008D9B2F /* lluri_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B550ACD9F3F008D9B2F /* lluri_tut.cpp */; };
47 DA306B5C0ACD9F6F008D9B2F /* llhttpclient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B5B0ACD9F6F008D9B2F /* llhttpclient.cpp */; };
48 DAD1C4CC0AE2C78C0054574C /* stats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DAD1C4CB0AE2C78C0054574C /* stats.cpp */; };
49 DAD1C4DE0AE2CA0C0054574C /* llcurl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DAD1C4DD0AE2CA0C0054574C /* llcurl.cpp */; };
50 FD15584D0A06BE2E00DE9AE5 /* io.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15584C0A06BE2E00DE9AE5 /* io.cpp */; };
51 FD15585C0A06BEB000DE9AE5 /* llbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558500A06BEB000DE9AE5 /* llbuffer.cpp */; };
52 FD15585E0A06BEB000DE9AE5 /* llbufferstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558520A06BEB000DE9AE5 /* llbufferstream.cpp */; };
53 FD1558600A06BEB000DE9AE5 /* llinstantmessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558540A06BEB000DE9AE5 /* llinstantmessage.cpp */; };
54 FD1558620A06BEB000DE9AE5 /* llioutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558560A06BEB000DE9AE5 /* llioutil.cpp */; };
55 FD1558640A06BEB000DE9AE5 /* llsdrpcclient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558580A06BEB000DE9AE5 /* llsdrpcclient.cpp */; };
56 FD1558660A06BEB000DE9AE5 /* llsdrpcserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15585A0A06BEB000DE9AE5 /* llsdrpcserver.cpp */; };
57 FD15587F0A06BFAB00DE9AE5 /* llfiltersd2xmlrpc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558770A06BFAB00DE9AE5 /* llfiltersd2xmlrpc.cpp */; };
58 FD1558810A06BFAB00DE9AE5 /* lliohttpserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558790A06BFAB00DE9AE5 /* lliohttpserver.cpp */; };
59 FD1558830A06BFAB00DE9AE5 /* lliopipe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15587B0A06BFAB00DE9AE5 /* lliopipe.cpp */; };
60 FD1558850A06BFAB00DE9AE5 /* llpumpio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15587D0A06BFAB00DE9AE5 /* llpumpio.cpp */; };
61 FD15588A0A06BFE400DE9AE5 /* llchainio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558880A06BFE400DE9AE5 /* llchainio.cpp */; };
62 FD15588E0A06BFF100DE9AE5 /* llmemorystream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15588C0A06BFF100DE9AE5 /* llmemorystream.cpp */; };
63 FD1558930A06C01400DE9AE5 /* llframetimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558910A06C01400DE9AE5 /* llframetimer.cpp */; };
64 FD1558970A06C05100DE9AE5 /* llurlrequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558950A06C05100DE9AE5 /* llurlrequest.cpp */; };
65 FD15589C0A06C08A00DE9AE5 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FD15589B0A06C08A00DE9AE5 /* libcurl.dylib */; };
66 FD1558A70A06C0D000DE9AE5 /* libxmlrpc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1558A60A06C0D000DE9AE5 /* libxmlrpc.a */; };
67 FD1558AA0A06C14E00DE9AE5 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1558A90A06C14E00DE9AE5 /* libiconv.dylib */; };
68 FD155EF40A08F0B300DE9AE5 /* m3math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155EF00A08F0B300DE9AE5 /* m3math.cpp */; };
69 FD155EF60A08F0B300DE9AE5 /* m4math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155EF20A08F0B300DE9AE5 /* m4math.cpp */; };
70 FD155EFA0A08F0DE00DE9AE5 /* llstringtable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155EF80A08F0DE00DE9AE5 /* llstringtable.cpp */; };
71 FD155F030A08F36A00DE9AE5 /* llmemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F010A08F36A00DE9AE5 /* llmemory.cpp */; };
72 FD155F0B0A08F60B00DE9AE5 /* llnullcipher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F090A08F60B00DE9AE5 /* llnullcipher.cpp */; };
73 FD155F0C0A08F60B00DE9AE5 /* llxorcipher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F0A0A08F60B00DE9AE5 /* llxorcipher.cpp */; };
74 FD155F100A08F63200DE9AE5 /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F0E0A08F63200DE9AE5 /* message.cpp */; };
75 FD155F1F0A08F9D200DE9AE5 /* llpacketring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F1D0A08F9D200DE9AE5 /* llpacketring.cpp */; };
76 FD155F240A08F9F600DE9AE5 /* v3math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F220A08F9F600DE9AE5 /* v3math.cpp */; };
77 FD155F2A0A08FA0F00DE9AE5 /* llpacketbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F280A08FA0F00DE9AE5 /* llpacketbuffer.cpp */; };
78 FD155F2F0A08FA9800DE9AE5 /* net.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F2D0A08FA9800DE9AE5 /* net.cpp */; };
79 FD155F340A08FAD900DE9AE5 /* llxfermanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F320A08FAD900DE9AE5 /* llxfermanager.cpp */; };
80 FD155F3F0A08FAF300DE9AE5 /* llxfer_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F370A08FAF300DE9AE5 /* llxfer_file.cpp */; };
81 FD155F410A08FAF300DE9AE5 /* llxfer_mem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F390A08FAF300DE9AE5 /* llxfer_mem.cpp */; };
82 FD155F430A08FAF300DE9AE5 /* llxfer_vfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F3B0A08FAF300DE9AE5 /* llxfer_vfile.cpp */; };
83 FD155F450A08FAF300DE9AE5 /* llxfer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F3D0A08FAF300DE9AE5 /* llxfer.cpp */; };
84 FD155F5D0A08FB5100DE9AE5 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD155F480A08FB5100DE9AE5 /* Carbon.framework */; };
85 FD155F610A08FD5900DE9AE5 /* llfasttimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */; };
86 FD155F670A08FD9100DE9AE5 /* message_string_table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F660A08FD9100DE9AE5 /* message_string_table.cpp */; };
87 FD396CDD0A1D37DF005DCB1F /* lltut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD396CDC0A1D37DF005DCB1F /* lltut.cpp */; };
88 FD396D160A1DFB4B005DCB1F /* reflection_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386A940D0A0B5F60001DE10D /* reflection_tut.cpp */; };
89 FD506A0609FEB58900E297C2 /* llsdserialize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD506A0409FEB58900E297C2 /* llsdserialize.cpp */; };
90 FD506A2509FEB79700E297C2 /* libaprutil-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD506A2409FEB79700E297C2 /* libaprutil-1.a */; };
91 FD506A2F09FEC37900E297C2 /* llsdserialize_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD506A2D09FEC37900E297C2 /* llsdserialize_tut.cpp */; };
92 FD506AA909FFC70100E297C2 /* llsdserialize_xml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD506AA709FFC70100E297C2 /* llsdserialize_xml.cpp */; };
93 FD506ADB09FFE09700E297C2 /* libexpat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD506ADA09FFE09700E297C2 /* libexpat.a */; };
94 FD5DF87B09C0A0FB007E3F78 /* test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DF87A09C0A0FB007E3F78 /* test.cpp */; };
95 FD5DF9B609C0A571007E3F78 /* libapr-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD5DF9B509C0A571007E3F78 /* libapr-1.a */; };
96 FD5DF9F609C0E20E007E3F78 /* llsd_new_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DF9F409C0E20E007E3F78 /* llsd_new_tut.cpp */; };
97 FD5DFA9109C1DF3E007E3F78 /* lldate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9009C1DF3E007E3F78 /* lldate.cpp */; };
98 FD5DFA9309C1DF4E007E3F78 /* lluuid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9209C1DF4E007E3F78 /* lluuid.cpp */; };
99 FD5DFA9909C1DFB7007E3F78 /* lluri.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9709C1DFB7007E3F78 /* lluri.cpp */; };
100 FD5DFAA009C1DFE2007E3F78 /* llerrorbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9C09C1DFE2007E3F78 /* llerrorbuffer.cpp */; };
101 FD5DFAA209C1DFE2007E3F78 /* llerrorstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9E09C1DFE2007E3F78 /* llerrorstream.cpp */; };
102 FD5DFAA609C1E01D007E3F78 /* llmd5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAA509C1E01D007E3F78 /* llmd5.cpp */; };
103 FD5DFAA909C1E056007E3F78 /* llerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAA809C1E056007E3F78 /* llerror.cpp */; };
104 FD5DFAAC09C1E09F007E3F78 /* llrand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAAB09C1E09F007E3F78 /* llrand.cpp */; };
105 FD5DFAAF09C1E101007E3F78 /* llapr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAAE09C1E101007E3F78 /* llapr.cpp */; };
106 FD5DFAB109C1E110007E3F78 /* llstring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAB009C1E110007E3F78 /* llstring.cpp */; };
107 FD5DFAB309C1E11A007E3F78 /* lltimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAB209C1E11A007E3F78 /* lltimer.cpp */; };
108 FD5DFAB909C1E13A007E3F78 /* u64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAB809C1E13A007E3F78 /* u64.cpp */; };
109 FD7325940A08E7A60072A37B /* common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325930A08E7A60072A37B /* common.cpp */; };
110 FD7325970A08E8260072A37B /* math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325960A08E8260072A37B /* math.cpp */; };
111 FD73259A0A08E8420072A37B /* inventory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325990A08E8420072A37B /* inventory.cpp */; };
112 FD73259F0A08E8A00072A37B /* llinventory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD73259D0A08E8A00072A37B /* llinventory.cpp */; };
113 FD7325A60A08E8F00072A37B /* llxmlnode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325A40A08E8F00072A37B /* llxmlnode.cpp */; };
114 FD7325AC0A08E9330072A37B /* llpermissions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325AA0A08E9330072A37B /* llpermissions.cpp */; };
115 FD7325B00A08E95F0072A37B /* llsaleinfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325AE0A08E95F0072A37B /* llsaleinfo.cpp */; };
116 FD7325BF0A08EA220072A37B /* lldir_mac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325B90A08EA220072A37B /* lldir_mac.cpp */; };
117 FD7325C10A08EA220072A37B /* lldir.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325BB0A08EA220072A37B /* lldir.cpp */; };
118 FD7325C30A08EA220072A37B /* llvfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325BD0A08EA220072A37B /* llvfile.cpp */; };
119 FD7325CA0A08EB370072A37B /* llcircuit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325C60A08EB370072A37B /* llcircuit.cpp */; };
120 FD7325CC0A08EB370072A37B /* message_prehash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325C80A08EB370072A37B /* message_prehash.cpp */; };
121 FD7325D30A08EB590072A37B /* llthrottle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325D10A08EB590072A37B /* llthrottle.cpp */; };
122 FD7325D80A08EB6B0072A37B /* lltransfermanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325D60A08EB6B0072A37B /* lltransfermanager.cpp */; };
123 FD7325E30A08EB970072A37B /* lltransfersourceasset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325DB0A08EB970072A37B /* lltransfersourceasset.cpp */; };
124 FD7325E50A08EB970072A37B /* lltransfersourcefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325DD0A08EB970072A37B /* lltransfersourcefile.cpp */; };
125 FD7325E70A08EB970072A37B /* lltransfertargetfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325DF0A08EB970072A37B /* lltransfertargetfile.cpp */; };
126 FD7325E90A08EB970072A37B /* lltransfertargetvfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325E10A08EB970072A37B /* lltransfertargetvfile.cpp */; };
127 FD7325EE0A08EBBF0072A37B /* llqueuedthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325EC0A08EBBF0072A37B /* llqueuedthread.cpp */; };
128 FD7325F20A08EBD20072A37B /* llvfsthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325F00A08EBD20072A37B /* llvfsthread.cpp */; };
129 FD7325F70A08EBE40072A37B /* llvfs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325F50A08EBE40072A37B /* llvfs.cpp */; };
130 FD7325FC0A08EC140072A37B /* llthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325FA0A08EC140072A37B /* llthread.cpp */; };
131 FD7326030A08EC490072A37B /* llassetstorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7326010A08EC490072A37B /* llassetstorage.cpp */; };
132 FD7326070A08EC5B0072A37B /* llassettype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7326050A08EC5B0072A37B /* llassettype.cpp */; };
133 FD73260E0A08ECB70072A37B /* lldatapacker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD73260C0A08ECB70072A37B /* lldatapacker.cpp */; };
134 FD7326130A08ECD90072A37B /* llhost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7326110A08ECD90072A37B /* llhost.cpp */; };
135 FD73261C0A08ED580072A37B /* llnamevalue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD73261A0A08ED580072A37B /* llnamevalue.cpp */; };
136 FD9996A30A1C15B10057C816 /* llsdhttpserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD9996A10A1C15AD0057C816 /* llsdhttpserver.cpp */; };
137 FD9996D70A1CA7570057C816 /* llpipeutil.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FD9996D50A1CA7570057C816 /* llpipeutil.h */; };
138 FD9996D80A1CA7570057C816 /* llpipeutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD9996D60A1CA7570057C816 /* llpipeutil.cpp */; };
139 FDBC106B0AEEC3CA00ED2E62 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FD15589B0A06C08A00DE9AE5 /* libcurl.dylib */; };
140 FDBC106D0AEEC3DA00ED2E62 /* llsd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DF9BE09C0A68F007E3F78 /* llsd.cpp */; };
141 FDBC106F0AEEC3E900ED2E62 /* lluuid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9209C1DF4E007E3F78 /* lluuid.cpp */; };
142 FDBC10710AEEC3F800ED2E62 /* llsdserialize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD506A0409FEB58900E297C2 /* llsdserialize.cpp */; };
143 FDBC10720AEEC3F900ED2E62 /* llsdserialize_xml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD506AA709FFC70100E297C2 /* llsdserialize_xml.cpp */; };
144 FDBC10740AEEC40F00ED2E62 /* libexpat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD506ADA09FFE09700E297C2 /* libexpat.a */; };
145 FDBC10750AEEC41600ED2E62 /* lldate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9009C1DF3E007E3F78 /* lldate.cpp */; };
146 FDBC10760AEEC41B00ED2E62 /* llmd5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAA509C1E01D007E3F78 /* llmd5.cpp */; };
147 FDBC10790AEEC42B00ED2E62 /* llerrorstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9E09C1DFE2007E3F78 /* llerrorstream.cpp */; };
148 FDBC107A0AEEC42C00ED2E62 /* llerrorbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9C09C1DFE2007E3F78 /* llerrorbuffer.cpp */; };
149 FDBC107B0AEEC43200ED2E62 /* lluri.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9709C1DFB7007E3F78 /* lluri.cpp */; };
150 FDBC107E0AEEC45100ED2E62 /* lltimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAB209C1E11A007E3F78 /* lltimer.cpp */; };
151 FDBC107F0AEEC45400ED2E62 /* llfasttimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */; };
152 FDBC10810AEEC46D00ED2E62 /* llapr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAAE09C1E101007E3F78 /* llapr.cpp */; };
153 FDBC10830AEEC47900ED2E62 /* libapr-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD5DF9B509C0A571007E3F78 /* libapr-1.a */; };
154 FDBC10840AEEC47A00ED2E62 /* libaprutil-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD506A2409FEB79700E297C2 /* libaprutil-1.a */; };
155 FDBC10860AEEC49800ED2E62 /* lliopipe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15587B0A06BFAB00DE9AE5 /* lliopipe.cpp */; };
156 FDBC10870AEEC49D00ED2E62 /* llpumpio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15587D0A06BFAB00DE9AE5 /* llpumpio.cpp */; };
157 FDBC10890AEEC4BA00ED2E62 /* llurlrequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558950A06C05100DE9AE5 /* llurlrequest.cpp */; };
158 FDBC108B0AEEC4CD00ED2E62 /* llbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558500A06BEB000DE9AE5 /* llbuffer.cpp */; };
159 FDBC108D0AEEC4E500ED2E62 /* llstring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAB009C1E110007E3F78 /* llstring.cpp */; };
160 FDBC108F0AEEC50200ED2E62 /* u64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAB809C1E13A007E3F78 /* u64.cpp */; };
161 FDBC10900AEEC50A00ED2E62 /* llmemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F010A08F36A00DE9AE5 /* llmemory.cpp */; };
162 FDBC10990AEEC57D00ED2E62 /* llhttpclient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B5B0ACD9F6F008D9B2F /* llhttpclient.cpp */; };
163 FDBC109D0AEEC5EE00ED2E62 /* llbufferstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558520A06BEB000DE9AE5 /* llbufferstream.cpp */; };
164 FDBC109F0AEEC5FB00ED2E62 /* llchainio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558880A06BFE400DE9AE5 /* llchainio.cpp */; };
165 FDBC10A10AEEC60F00ED2E62 /* llioutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558560A06BEB000DE9AE5 /* llioutil.cpp */; };
166 FDBC10A30AEEC62400ED2E62 /* llthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325FA0A08EC140072A37B /* llthread.cpp */; };
167 FDBC10A50AEEC63200ED2E62 /* llerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAA809C1E056007E3F78 /* llerror.cpp */; };
168 FDBC10A70AEEC64100ED2E62 /* llrand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAAB09C1E09F007E3F78 /* llrand.cpp */; };
169 FDBC10A90AEEC65700ED2E62 /* llstreamtools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B440ACD9E8B008D9B2F /* llstreamtools.cpp */; };
170 FDBC10AB0AEEC66100ED2E62 /* testwebclient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA01B2040ADE839D00A44198 /* testwebclient.cpp */; };
171 FDBC10AD0AEEC67700ED2E62 /* llframetimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558910A06C01400DE9AE5 /* llframetimer.cpp */; };
172 FDCB2A670AF80D9000C44EBA /* llprocessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDCB2A650AF80D9000C44EBA /* llprocessor.cpp */; };
173 FDCB2A680AF80D9000C44EBA /* llprocessor.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FDCB2A660AF80D9000C44EBA /* llprocessor.h */; };
174 FDEC4F5509F7EF7A007BAEEC /* llsd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DF9BE09C0A68F007E3F78 /* llsd.cpp */; };
175 FDFAD4210AFFFCC30048A0C7 /* llhttpnode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDFAD41F0AFFFCC30048A0C7 /* llhttpnode.cpp */; };
176 FDFAD4220AFFFCC30048A0C7 /* llhttpnode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FDFAD4200AFFFCC30048A0C7 /* llhttpnode.h */; };
177 FDFBED130A1B591B0056E81E /* lliohttpserver_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDFBED120A1B591B0056E81E /* lliohttpserver_tut.cpp */; };
178/* End PBXBuildFile section */
179
180/* Begin PBXContainerItemProxy section */
181 FD5DF9A809C0A537007E3F78 /* PBXContainerItemProxy */ = {
182 isa = PBXContainerItemProxy;
183 containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
184 proxyType = 1;
185 remoteGlobalIDString = FD5DF9A109C0A4F5007E3F78;
186 remoteInfo = "third party libs";
187 };
188 FDBC10500AEEB7C300ED2E62 /* PBXContainerItemProxy */ = {
189 isa = PBXContainerItemProxy;
190 containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
191 proxyType = 1;
192 remoteGlobalIDString = FD5DF9A109C0A4F5007E3F78;
193 remoteInfo = "third party libs";
194 };
195 FDBC10510AEEB7C300ED2E62 /* PBXContainerItemProxy */ = {
196 isa = PBXContainerItemProxy;
197 containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
198 proxyType = 1;
199 remoteGlobalIDString = FD5DF9A109C0A4F5007E3F78;
200 remoteInfo = "third party libs";
201 };
202/* End PBXContainerItemProxy section */
203
204/* Begin PBXCopyFilesBuildPhase section */
205 8DD76F690486A84900D96B5E /* CopyFiles */ = {
206 isa = PBXCopyFilesBuildPhase;
207 buildActionMask = 8;
208 dstPath = /usr/share/man/man1/;
209 dstSubfolderSpec = 0;
210 files = (
211 389CFB460A0B69C700EE2094 /* llfile.h in CopyFiles */,
212 386C3F080A14C85000CF4511 /* lliosocket.h in CopyFiles */,
213 38A8BF6A0A18C38800814862 /* reflective.h in CopyFiles */,
214 FD9996D70A1CA7570057C816 /* llpipeutil.h in CopyFiles */,
215 FDCB2A680AF80D9000C44EBA /* llprocessor.h in CopyFiles */,
216 FDFAD4220AFFFCC30048A0C7 /* llhttpnode.h in CopyFiles */,
217 91469E820B4486F20009E8F9 /* llmime.h in CopyFiles */,
218 91469E8E0B4489420009E8F9 /* llquaternion.h in CopyFiles */,
219 );
220 runOnlyForDeploymentPostprocessing = 1;
221 };
222/* End PBXCopyFilesBuildPhase section */
223
224/* Begin PBXFileReference section */
225 383A14F90A1A1C6700F420F7 /* metapropertyt.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = metapropertyt.h; sourceTree = "<group>"; };
226 386A940D0A0B5F60001DE10D /* reflection_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = reflection_tut.cpp; sourceTree = "<group>"; };
227 386C3F050A14C85000CF4511 /* lliosocket.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lliosocket.cpp; sourceTree = "<group>"; };
228 386C3F060A14C85000CF4511 /* lliosocket.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lliosocket.h; sourceTree = "<group>"; };
229 389CFB440A0B69C700EE2094 /* llfile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfile.h; sourceTree = "<group>"; };
230 389CFB450A0B69C700EE2094 /* llfile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfile.cpp; sourceTree = "<group>"; };
231 38A8BEAA0A18A2BC00814862 /* metaclass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = metaclass.cpp; sourceTree = "<group>"; };
232 38A8BF140A18A6FF00814862 /* metaclass.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = metaclass.h; sourceTree = "<group>"; };
233 38A8BF620A18C31D00814862 /* metaproperty.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = metaproperty.cpp; sourceTree = "<group>"; };
234 38A8BF690A18C38800814862 /* reflective.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = reflective.h; sourceTree = "<group>"; };
235 38A8BF740A18C42900814862 /* reflective.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = reflective.cpp; sourceTree = "<group>"; };
236 8DD76F6C0486A84900D96B5E /* MacTester */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = MacTester; sourceTree = BUILT_PRODUCTS_DIR; };
237 91469E7F0B4486F20009E8F9 /* llmime.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmime.cpp; sourceTree = "<group>"; };
238 91469E800B4486F20009E8F9 /* llmime.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llmime.h; sourceTree = "<group>"; };
239 91469E830B44870B0009E8F9 /* llmime_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmime_tut.cpp; sourceTree = "<group>"; };
240 91469E8B0B4489420009E8F9 /* llquaternion.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llquaternion.cpp; sourceTree = "<group>"; };
241 91469E8C0B4489420009E8F9 /* llquaternion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llquaternion.h; sourceTree = "<group>"; };
242 DA01B1EF0ADE82C400A44198 /* TestWebClient */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestWebClient; sourceTree = BUILT_PRODUCTS_DIR; };
243 DA01B2040ADE839D00A44198 /* testwebclient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = testwebclient.cpp; sourceTree = "<group>"; };
244 DA306B430ACD9E8B008D9B2F /* llsdutil.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsdutil.cpp; sourceTree = "<group>"; };
245 DA306B440ACD9E8B008D9B2F /* llstreamtools.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llstreamtools.cpp; sourceTree = "<group>"; };
246 DA306B480ACD9EBC008D9B2F /* llapp.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llapp.cpp; sourceTree = "<group>"; };
247 DA306B4B0ACD9EFD008D9B2F /* llcommon.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcommon.cpp; sourceTree = "<group>"; };
248 DA306B4C0ACD9EFD008D9B2F /* llerrorthread.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerrorthread.cpp; sourceTree = "<group>"; };
249 DA306B4D0ACD9EFD008D9B2F /* llrun.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llrun.cpp; sourceTree = "<group>"; };
250 DA306B520ACD9F3F008D9B2F /* llapp_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llapp_tut.cpp; sourceTree = "<group>"; };
251 DA306B530ACD9F3F008D9B2F /* llhttpclient_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhttpclient_tut.cpp; sourceTree = "<group>"; };
252 DA306B540ACD9F3F008D9B2F /* lltiming_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltiming_tut.cpp; sourceTree = "<group>"; };
253 DA306B550ACD9F3F008D9B2F /* lluri_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluri_tut.cpp; sourceTree = "<group>"; };
254 DA306B5B0ACD9F6F008D9B2F /* llhttpclient.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhttpclient.cpp; sourceTree = "<group>"; };
255 DAD1C4CA0AE2C78C0054574C /* stats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stats.h; sourceTree = "<group>"; };
256 DAD1C4CB0AE2C78C0054574C /* stats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stats.cpp; sourceTree = "<group>"; };
257 DAD1C4DC0AE2CA0C0054574C /* llcurl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = llcurl.h; sourceTree = "<group>"; };
258 DAD1C4DD0AE2CA0C0054574C /* llcurl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llcurl.cpp; sourceTree = "<group>"; };
259 FD15584C0A06BE2E00DE9AE5 /* io.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = io.cpp; sourceTree = "<group>"; };
260 FD1558500A06BEB000DE9AE5 /* llbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llbuffer.cpp; sourceTree = "<group>"; };
261 FD1558510A06BEB000DE9AE5 /* llbuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llbuffer.h; sourceTree = "<group>"; };
262 FD1558520A06BEB000DE9AE5 /* llbufferstream.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llbufferstream.cpp; sourceTree = "<group>"; };
263 FD1558530A06BEB000DE9AE5 /* llbufferstream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llbufferstream.h; sourceTree = "<group>"; };
264 FD1558540A06BEB000DE9AE5 /* llinstantmessage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llinstantmessage.cpp; sourceTree = "<group>"; };
265 FD1558550A06BEB000DE9AE5 /* llinstantmessage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llinstantmessage.h; sourceTree = "<group>"; };
266 FD1558560A06BEB000DE9AE5 /* llioutil.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llioutil.cpp; sourceTree = "<group>"; };
267 FD1558570A06BEB000DE9AE5 /* llioutil.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llioutil.h; sourceTree = "<group>"; };
268 FD1558580A06BEB000DE9AE5 /* llsdrpcclient.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsdrpcclient.cpp; sourceTree = "<group>"; };
269 FD1558590A06BEB000DE9AE5 /* llsdrpcclient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llsdrpcclient.h; sourceTree = "<group>"; };
270 FD15585A0A06BEB000DE9AE5 /* llsdrpcserver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsdrpcserver.cpp; sourceTree = "<group>"; };
271 FD15585B0A06BEB000DE9AE5 /* llsdrpcserver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llsdrpcserver.h; sourceTree = "<group>"; };
272 FD1558770A06BFAB00DE9AE5 /* llfiltersd2xmlrpc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfiltersd2xmlrpc.cpp; sourceTree = "<group>"; };
273 FD1558780A06BFAB00DE9AE5 /* llfiltersd2xmlrpc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfiltersd2xmlrpc.h; sourceTree = "<group>"; };
274 FD1558790A06BFAB00DE9AE5 /* lliohttpserver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lliohttpserver.cpp; sourceTree = "<group>"; };
275 FD15587A0A06BFAB00DE9AE5 /* lliohttpserver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lliohttpserver.h; sourceTree = "<group>"; };
276 FD15587B0A06BFAB00DE9AE5 /* lliopipe.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lliopipe.cpp; sourceTree = "<group>"; };
277 FD15587C0A06BFAB00DE9AE5 /* lliopipe.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lliopipe.h; sourceTree = "<group>"; };
278 FD15587D0A06BFAB00DE9AE5 /* llpumpio.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpumpio.cpp; sourceTree = "<group>"; };
279 FD15587E0A06BFAB00DE9AE5 /* llpumpio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpumpio.h; sourceTree = "<group>"; };
280 FD1558880A06BFE400DE9AE5 /* llchainio.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llchainio.cpp; sourceTree = "<group>"; };
281 FD1558890A06BFE400DE9AE5 /* llchainio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llchainio.h; sourceTree = "<group>"; };
282 FD15588C0A06BFF100DE9AE5 /* llmemorystream.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmemorystream.cpp; sourceTree = "<group>"; };
283 FD15588D0A06BFF100DE9AE5 /* llmemorystream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llmemorystream.h; sourceTree = "<group>"; };
284 FD1558910A06C01400DE9AE5 /* llframetimer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llframetimer.cpp; sourceTree = "<group>"; };
285 FD1558920A06C01400DE9AE5 /* llframetimer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llframetimer.h; sourceTree = "<group>"; };
286 FD1558950A06C05100DE9AE5 /* llurlrequest.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llurlrequest.cpp; sourceTree = "<group>"; };
287 FD1558960A06C05100DE9AE5 /* llurlrequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llurlrequest.h; sourceTree = "<group>"; };
288 FD15589B0A06C08A00DE9AE5 /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = /usr/lib/libcurl.dylib; sourceTree = "<absolute>"; };
289 FD1558A60A06C0D000DE9AE5 /* libxmlrpc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libxmlrpc.a; path = build/Debug/libxmlrpc.a; sourceTree = "<group>"; };
290 FD1558A90A06C14E00DE9AE5 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = /usr/lib/libiconv.dylib; sourceTree = "<absolute>"; };
291 FD155EF00A08F0B300DE9AE5 /* m3math.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = m3math.cpp; sourceTree = "<group>"; };
292 FD155EF10A08F0B300DE9AE5 /* m3math.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = m3math.h; sourceTree = "<group>"; };
293 FD155EF20A08F0B300DE9AE5 /* m4math.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = m4math.cpp; sourceTree = "<group>"; };
294 FD155EF30A08F0B300DE9AE5 /* m4math.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = m4math.h; sourceTree = "<group>"; };
295 FD155EF80A08F0DE00DE9AE5 /* llstringtable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llstringtable.cpp; sourceTree = "<group>"; };
296 FD155EF90A08F0DE00DE9AE5 /* llstringtable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llstringtable.h; sourceTree = "<group>"; };
297 FD155F010A08F36A00DE9AE5 /* llmemory.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmemory.cpp; sourceTree = "<group>"; };
298 FD155F020A08F36A00DE9AE5 /* llmemory.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llmemory.h; sourceTree = "<group>"; };
299 FD155F050A08F37900DE9AE5 /* llcrypto.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcrypto.h; sourceTree = "<group>"; };
300 FD155F090A08F60B00DE9AE5 /* llnullcipher.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llnullcipher.cpp; sourceTree = "<group>"; };
301 FD155F0A0A08F60B00DE9AE5 /* llxorcipher.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxorcipher.cpp; sourceTree = "<group>"; };
302 FD155F0E0A08F63200DE9AE5 /* message.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = message.cpp; sourceTree = "<group>"; };
303 FD155F1D0A08F9D200DE9AE5 /* llpacketring.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpacketring.cpp; sourceTree = "<group>"; };
304 FD155F1E0A08F9D200DE9AE5 /* llpacketring.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpacketring.h; sourceTree = "<group>"; };
305 FD155F220A08F9F600DE9AE5 /* v3math.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = v3math.cpp; sourceTree = "<group>"; };
306 FD155F230A08F9F600DE9AE5 /* v3math.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = v3math.h; sourceTree = "<group>"; };
307 FD155F280A08FA0F00DE9AE5 /* llpacketbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpacketbuffer.cpp; sourceTree = "<group>"; };
308 FD155F290A08FA0F00DE9AE5 /* llpacketbuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpacketbuffer.h; sourceTree = "<group>"; };
309 FD155F2D0A08FA9800DE9AE5 /* net.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = net.cpp; sourceTree = "<group>"; };
310 FD155F2E0A08FA9800DE9AE5 /* net.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = net.h; sourceTree = "<group>"; };
311 FD155F320A08FAD900DE9AE5 /* llxfermanager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxfermanager.cpp; sourceTree = "<group>"; };
312 FD155F330A08FAD900DE9AE5 /* llxfermanager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxfermanager.h; sourceTree = "<group>"; };
313 FD155F370A08FAF300DE9AE5 /* llxfer_file.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxfer_file.cpp; sourceTree = "<group>"; };
314 FD155F380A08FAF300DE9AE5 /* llxfer_file.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxfer_file.h; sourceTree = "<group>"; };
315 FD155F390A08FAF300DE9AE5 /* llxfer_mem.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxfer_mem.cpp; sourceTree = "<group>"; };
316 FD155F3A0A08FAF300DE9AE5 /* llxfer_mem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxfer_mem.h; sourceTree = "<group>"; };
317 FD155F3B0A08FAF300DE9AE5 /* llxfer_vfile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxfer_vfile.cpp; sourceTree = "<group>"; };
318 FD155F3C0A08FAF300DE9AE5 /* llxfer_vfile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxfer_vfile.h; sourceTree = "<group>"; };
319 FD155F3D0A08FAF300DE9AE5 /* llxfer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxfer.cpp; sourceTree = "<group>"; };
320 FD155F3E0A08FAF300DE9AE5 /* llxfer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxfer.h; sourceTree = "<group>"; };
321 FD155F480A08FB5100DE9AE5 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
322 FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfasttimer.cpp; sourceTree = "<group>"; };
323 FD155F600A08FD5900DE9AE5 /* llfasttimer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfasttimer.h; sourceTree = "<group>"; };
324 FD155F660A08FD9100DE9AE5 /* message_string_table.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = message_string_table.cpp; sourceTree = "<group>"; };
325 FD396CD80A1D3768005DCB1F /* lltut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltut.h; sourceTree = "<group>"; };
326 FD396CDC0A1D37DF005DCB1F /* lltut.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lltut.cpp; sourceTree = "<group>"; };
327 FD506A0409FEB58900E297C2 /* llsdserialize.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsdserialize.cpp; sourceTree = "<group>"; };
328 FD506A0509FEB58900E297C2 /* llsdserialize.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llsdserialize.h; sourceTree = "<group>"; };
329 FD506A2409FEB79700E297C2 /* libaprutil-1.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libaprutil-1.a"; path = "build/Debug/libaprutil-1.a"; sourceTree = "<group>"; };
330 FD506A2D09FEC37900E297C2 /* llsdserialize_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llsdserialize_tut.cpp; sourceTree = "<group>"; };
331 FD506AA609FFC70100E297C2 /* llsdserialize_xml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = llsdserialize_xml.h; sourceTree = "<group>"; };
332 FD506AA709FFC70100E297C2 /* llsdserialize_xml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llsdserialize_xml.cpp; sourceTree = "<group>"; };
333 FD506ADA09FFE09700E297C2 /* libexpat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexpat.a; path = build/Debug/libexpat.a; sourceTree = "<group>"; };
334 FD5DF87A09C0A0FB007E3F78 /* test.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test.cpp; sourceTree = "<group>"; };
335 FD5DF88609C0A196007E3F78 /* linden_common.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = linden_common.h; sourceTree = "<group>"; };
336 FD5DF9B509C0A571007E3F78 /* libapr-1.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libapr-1.a"; sourceTree = BUILT_PRODUCTS_DIR; };
337 FD5DF9BE09C0A68F007E3F78 /* llsd.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsd.cpp; sourceTree = "<group>"; };
338 FD5DF9BF09C0A68F007E3F78 /* llsd.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llsd.h; sourceTree = "<group>"; };
339 FD5DF9F409C0E20E007E3F78 /* llsd_new_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llsd_new_tut.cpp; sourceTree = "<group>"; };
340 FD5DFA9009C1DF3E007E3F78 /* lldate.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldate.cpp; sourceTree = "<group>"; };
341 FD5DFA9209C1DF4E007E3F78 /* lluuid.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluuid.cpp; sourceTree = "<group>"; };
342 FD5DFA9709C1DFB7007E3F78 /* lluri.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluri.cpp; sourceTree = "<group>"; };
343 FD5DFA9C09C1DFE2007E3F78 /* llerrorbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerrorbuffer.cpp; sourceTree = "<group>"; };
344 FD5DFA9E09C1DFE2007E3F78 /* llerrorstream.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerrorstream.cpp; sourceTree = "<group>"; };
345 FD5DFAA509C1E01D007E3F78 /* llmd5.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmd5.cpp; sourceTree = "<group>"; };
346 FD5DFAA809C1E056007E3F78 /* llerror.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerror.cpp; sourceTree = "<group>"; };
347 FD5DFAAB09C1E09F007E3F78 /* llrand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llrand.cpp; sourceTree = "<group>"; };
348 FD5DFAAE09C1E101007E3F78 /* llapr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llapr.cpp; sourceTree = "<group>"; };
349 FD5DFAB009C1E110007E3F78 /* llstring.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llstring.cpp; sourceTree = "<group>"; };
350 FD5DFAB209C1E11A007E3F78 /* lltimer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltimer.cpp; sourceTree = "<group>"; };
351 FD5DFAB809C1E13A007E3F78 /* u64.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = u64.cpp; sourceTree = "<group>"; };
352 FD7325790A0834080072A37B /* llapr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llapr.h; sourceTree = "<group>"; };
353 FD73257A0A0834080072A37B /* lldate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldate.h; sourceTree = "<group>"; };
354 FD73257B0A0834080072A37B /* llerror.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llerror.h; sourceTree = "<group>"; };
355 FD73257C0A0834080072A37B /* llerrorbuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llerrorbuffer.h; sourceTree = "<group>"; };
356 FD73257D0A0834080072A37B /* llstring.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llstring.h; sourceTree = "<group>"; };
357 FD73257E0A0834080072A37B /* lltimer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltimer.h; sourceTree = "<group>"; };
358 FD73257F0A0834080072A37B /* lluri.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lluri.h; sourceTree = "<group>"; };
359 FD7325800A0834080072A37B /* u64.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = u64.h; sourceTree = "<group>"; };
360 FD7325930A08E7A60072A37B /* common.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = common.cpp; sourceTree = "<group>"; };
361 FD7325960A08E8260072A37B /* math.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = math.cpp; sourceTree = "<group>"; };
362 FD7325990A08E8420072A37B /* inventory.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = inventory.cpp; sourceTree = "<group>"; };
363 FD73259D0A08E8A00072A37B /* llinventory.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llinventory.cpp; sourceTree = "<group>"; };
364 FD73259E0A08E8A00072A37B /* llinventory.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llinventory.h; sourceTree = "<group>"; };
365 FD7325A40A08E8F00072A37B /* llxmlnode.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxmlnode.cpp; sourceTree = "<group>"; };
366 FD7325A50A08E8F00072A37B /* llxmlnode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxmlnode.h; sourceTree = "<group>"; };
367 FD7325AA0A08E9330072A37B /* llpermissions.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpermissions.cpp; sourceTree = "<group>"; };
368 FD7325AB0A08E9330072A37B /* llpermissions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpermissions.h; sourceTree = "<group>"; };
369 FD7325AE0A08E95F0072A37B /* llsaleinfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsaleinfo.cpp; sourceTree = "<group>"; };
370 FD7325AF0A08E95F0072A37B /* llsaleinfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llsaleinfo.h; sourceTree = "<group>"; };
371 FD7325B30A08E9B10072A37B /* message.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = message.cpp; sourceTree = "<group>"; };
372 FD7325B40A08E9B10072A37B /* message.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = message.h; sourceTree = "<group>"; };
373 FD7325B90A08EA220072A37B /* lldir_mac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldir_mac.cpp; sourceTree = "<group>"; };
374 FD7325BA0A08EA220072A37B /* lldir_mac.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldir_mac.h; sourceTree = "<group>"; };
375 FD7325BB0A08EA220072A37B /* lldir.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldir.cpp; sourceTree = "<group>"; };
376 FD7325BC0A08EA220072A37B /* lldir.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldir.h; sourceTree = "<group>"; };
377 FD7325BD0A08EA220072A37B /* llvfile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvfile.cpp; sourceTree = "<group>"; };
378 FD7325BE0A08EA220072A37B /* llvfile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvfile.h; sourceTree = "<group>"; };
379 FD7325C60A08EB370072A37B /* llcircuit.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcircuit.cpp; sourceTree = "<group>"; };
380 FD7325C70A08EB370072A37B /* llcircuit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcircuit.h; sourceTree = "<group>"; };
381 FD7325C80A08EB370072A37B /* message_prehash.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = message_prehash.cpp; sourceTree = "<group>"; };
382 FD7325C90A08EB370072A37B /* message_prehash.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = message_prehash.h; sourceTree = "<group>"; };
383 FD7325D10A08EB590072A37B /* llthrottle.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llthrottle.cpp; sourceTree = "<group>"; };
384 FD7325D20A08EB590072A37B /* llthrottle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llthrottle.h; sourceTree = "<group>"; };
385 FD7325D60A08EB6B0072A37B /* lltransfermanager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltransfermanager.cpp; sourceTree = "<group>"; };
386 FD7325D70A08EB6B0072A37B /* lltransfermanager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltransfermanager.h; sourceTree = "<group>"; };
387 FD7325DB0A08EB970072A37B /* lltransfersourceasset.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltransfersourceasset.cpp; sourceTree = "<group>"; };
388 FD7325DC0A08EB970072A37B /* lltransfersourceasset.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltransfersourceasset.h; sourceTree = "<group>"; };
389 FD7325DD0A08EB970072A37B /* lltransfersourcefile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltransfersourcefile.cpp; sourceTree = "<group>"; };
390 FD7325DE0A08EB970072A37B /* lltransfersourcefile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltransfersourcefile.h; sourceTree = "<group>"; };
391 FD7325DF0A08EB970072A37B /* lltransfertargetfile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltransfertargetfile.cpp; sourceTree = "<group>"; };
392 FD7325E00A08EB970072A37B /* lltransfertargetfile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltransfertargetfile.h; sourceTree = "<group>"; };
393 FD7325E10A08EB970072A37B /* lltransfertargetvfile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltransfertargetvfile.cpp; sourceTree = "<group>"; };
394 FD7325E20A08EB970072A37B /* lltransfertargetvfile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltransfertargetvfile.h; sourceTree = "<group>"; };
395 FD7325EC0A08EBBF0072A37B /* llqueuedthread.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llqueuedthread.cpp; sourceTree = "<group>"; };
396 FD7325ED0A08EBBF0072A37B /* llqueuedthread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llqueuedthread.h; sourceTree = "<group>"; };
397 FD7325F00A08EBD20072A37B /* llvfsthread.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvfsthread.cpp; sourceTree = "<group>"; };
398 FD7325F10A08EBD20072A37B /* llvfsthread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvfsthread.h; sourceTree = "<group>"; };
399 FD7325F50A08EBE40072A37B /* llvfs.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvfs.cpp; sourceTree = "<group>"; };
400 FD7325F60A08EBE40072A37B /* llvfs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvfs.h; sourceTree = "<group>"; };
401 FD7325FA0A08EC140072A37B /* llthread.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llthread.cpp; sourceTree = "<group>"; };
402 FD7325FB0A08EC140072A37B /* llthread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llthread.h; sourceTree = "<group>"; };
403 FD7326010A08EC490072A37B /* llassetstorage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llassetstorage.cpp; sourceTree = "<group>"; };
404 FD7326020A08EC490072A37B /* llassetstorage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llassetstorage.h; sourceTree = "<group>"; };
405 FD7326050A08EC5B0072A37B /* llassettype.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llassettype.cpp; sourceTree = "<group>"; };
406 FD7326060A08EC5B0072A37B /* llassettype.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llassettype.h; sourceTree = "<group>"; };
407 FD73260C0A08ECB70072A37B /* lldatapacker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldatapacker.cpp; sourceTree = "<group>"; };
408 FD73260D0A08ECB70072A37B /* lldatapacker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldatapacker.h; sourceTree = "<group>"; };
409 FD7326110A08ECD90072A37B /* llhost.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhost.cpp; sourceTree = "<group>"; };
410 FD7326120A08ECD90072A37B /* llhost.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llhost.h; sourceTree = "<group>"; };
411 FD73261A0A08ED580072A37B /* llnamevalue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llnamevalue.cpp; sourceTree = "<group>"; };
412 FD73261B0A08ED580072A37B /* llnamevalue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llnamevalue.h; sourceTree = "<group>"; };
413 FD7326220A08ED980072A37B /* llrand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llrand.h; sourceTree = "<group>"; };
414 FD7326230A08ED980072A37B /* lluuid.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lluuid.h; sourceTree = "<group>"; };
415 FD7326260A08EDA60072A37B /* llmd5.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llmd5.h; sourceTree = "<group>"; };
416 FD9996A10A1C15AD0057C816 /* llsdhttpserver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsdhttpserver.cpp; sourceTree = "<group>"; };
417 FD9996A20A1C15AD0057C816 /* llsdhttpserver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llsdhttpserver.h; sourceTree = "<group>"; };
418 FD9996D50A1CA7570057C816 /* llpipeutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = llpipeutil.h; sourceTree = "<group>"; };
419 FD9996D60A1CA7570057C816 /* llpipeutil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llpipeutil.cpp; sourceTree = "<group>"; };
420 FDBC105C0AEEC30000ED2E62 /* llhttpclient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llhttpclient.h; sourceTree = "<group>"; };
421 FDBC105F0AEEC33000ED2E62 /* llskipmap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llskipmap.h; sourceTree = "<group>"; };
422 FDBC10620AEEC39000ED2E62 /* lldefs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldefs.h; sourceTree = "<group>"; };
423 FDBC10630AEEC39000ED2E62 /* stdenums.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stdenums.h; sourceTree = "<group>"; };
424 FDBC10640AEEC39000ED2E62 /* string_table.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = string_table.h; sourceTree = "<group>"; };
425 FDBC10660AEEC3A600ED2E62 /* llpriqueuemap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpriqueuemap.h; sourceTree = "<group>"; };
426 FDCB2A650AF80D9000C44EBA /* llprocessor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llprocessor.cpp; sourceTree = "<group>"; };
427 FDCB2A660AF80D9000C44EBA /* llprocessor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llprocessor.h; sourceTree = "<group>"; };
428 FDF2E4180ADD7B620003B83E /* TestWebServer */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestWebServer; sourceTree = BUILT_PRODUCTS_DIR; };
429 FDF2E5580ADDBB7F0003B83E /* llhttpdelayeddata.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhttpdelayeddata.cpp; sourceTree = "<group>"; };
430 FDF2E5590ADDBB7F0003B83E /* llhttpdelayeddata.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llhttpdelayeddata.h; sourceTree = "<group>"; };
431 FDF2E55A0ADDBB7F0003B83E /* llwebserver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llwebserver.cpp; sourceTree = "<group>"; };
432 FDF2E55B0ADDBB7F0003B83E /* llwebserver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llwebserver.h; sourceTree = "<group>"; };
433 FDF2E55C0ADDBB7F0003B83E /* testwebserver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = testwebserver.cpp; sourceTree = "<group>"; };
434 FDFAD41F0AFFFCC30048A0C7 /* llhttpnode.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhttpnode.cpp; sourceTree = "<group>"; };
435 FDFAD4200AFFFCC30048A0C7 /* llhttpnode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llhttpnode.h; sourceTree = "<group>"; };
436 FDFBED120A1B591B0056E81E /* lliohttpserver_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lliohttpserver_tut.cpp; sourceTree = "<group>"; };
437/* End PBXFileReference section */
438
439/* Begin PBXFrameworksBuildPhase section */
440 8DD76F660486A84900D96B5E /* Frameworks */ = {
441 isa = PBXFrameworksBuildPhase;
442 buildActionMask = 2147483647;
443 files = (
444 FD5DF9B609C0A571007E3F78 /* libapr-1.a in Frameworks */,
445 FD506A2509FEB79700E297C2 /* libaprutil-1.a in Frameworks */,
446 FD506ADB09FFE09700E297C2 /* libexpat.a in Frameworks */,
447 FD15589C0A06C08A00DE9AE5 /* libcurl.dylib in Frameworks */,
448 FD1558A70A06C0D000DE9AE5 /* libxmlrpc.a in Frameworks */,
449 FD1558AA0A06C14E00DE9AE5 /* libiconv.dylib in Frameworks */,
450 FD155F5D0A08FB5100DE9AE5 /* Carbon.framework in Frameworks */,
451 );
452 runOnlyForDeploymentPostprocessing = 0;
453 };
454 DA01B1E80ADE82C400A44198 /* Frameworks */ = {
455 isa = PBXFrameworksBuildPhase;
456 buildActionMask = 2147483647;
457 files = (
458 FDBC106B0AEEC3CA00ED2E62 /* libcurl.dylib in Frameworks */,
459 FDBC10740AEEC40F00ED2E62 /* libexpat.a in Frameworks */,
460 FDBC10830AEEC47900ED2E62 /* libapr-1.a in Frameworks */,
461 FDBC10840AEEC47A00ED2E62 /* libaprutil-1.a in Frameworks */,
462 );
463 runOnlyForDeploymentPostprocessing = 0;
464 };
465 FDF2E4160ADD7B620003B83E /* Frameworks */ = {
466 isa = PBXFrameworksBuildPhase;
467 buildActionMask = 2147483647;
468 files = (
469 );
470 runOnlyForDeploymentPostprocessing = 0;
471 };
472/* End PBXFrameworksBuildPhase section */
473
474/* Begin PBXGroup section */
475 08FB7794FE84155DC02AAC07 /* MacTester */ = {
476 isa = PBXGroup;
477 children = (
478 FD5DF88009C0A17D007E3F78 /* llcommon */,
479 FD73259C0A08E8520072A37B /* llinventory */,
480 FD5DF9CD09C0A72C007E3F78 /* llmath */,
481 FD15584F0A06BE4100DE9AE5 /* llmessage */,
482 FD7325B80A08E9FC0072A37B /* llvfs */,
483 FD7325A80A08E8F50072A37B /* llxml */,
484 08FB7795FE84155DC02AAC07 /* test */,
485 FD15589A0A06C07A00DE9AE5 /* System Libraries */,
486 FD5DF9B309C0A550007E3F78 /* Third Party Libs */,
487 1AB674ADFE9D54B511CA2CBB /* Products */,
488 );
489 name = MacTester;
490 sourceTree = "<group>";
491 };
492 08FB7795FE84155DC02AAC07 /* test */ = {
493 isa = PBXGroup;
494 children = (
495 DA01B1F10ADE831200A44198 /* testwebclient */,
496 FDF2E5600ADDBB900003B83E /* testwebserver */,
497 91469E830B44870B0009E8F9 /* llmime_tut.cpp */,
498 DA306B520ACD9F3F008D9B2F /* llapp_tut.cpp */,
499 DA306B530ACD9F3F008D9B2F /* llhttpclient_tut.cpp */,
500 DA306B540ACD9F3F008D9B2F /* lltiming_tut.cpp */,
501 DA306B550ACD9F3F008D9B2F /* lluri_tut.cpp */,
502 386A940D0A0B5F60001DE10D /* reflection_tut.cpp */,
503 FD7325930A08E7A60072A37B /* common.cpp */,
504 FD7325990A08E8420072A37B /* inventory.cpp */,
505 FD15584C0A06BE2E00DE9AE5 /* io.cpp */,
506 FD5DF9F409C0E20E007E3F78 /* llsd_new_tut.cpp */,
507 FD506A2D09FEC37900E297C2 /* llsdserialize_tut.cpp */,
508 FD7325960A08E8260072A37B /* math.cpp */,
509 FD5DF87A09C0A0FB007E3F78 /* test.cpp */,
510 FDFBED120A1B591B0056E81E /* lliohttpserver_tut.cpp */,
511 FD9996D50A1CA7570057C816 /* llpipeutil.h */,
512 FD9996D60A1CA7570057C816 /* llpipeutil.cpp */,
513 FD396CD80A1D3768005DCB1F /* lltut.h */,
514 FD396CDC0A1D37DF005DCB1F /* lltut.cpp */,
515 );
516 name = test;
517 sourceTree = "<group>";
518 };
519 1AB674ADFE9D54B511CA2CBB /* Products */ = {
520 isa = PBXGroup;
521 children = (
522 8DD76F6C0486A84900D96B5E /* MacTester */,
523 FDF2E4180ADD7B620003B83E /* TestWebServer */,
524 DA01B1EF0ADE82C400A44198 /* TestWebClient */,
525 );
526 name = Products;
527 sourceTree = "<group>";
528 };
529 DA01B1F10ADE831200A44198 /* testwebclient */ = {
530 isa = PBXGroup;
531 children = (
532 DA01B2040ADE839D00A44198 /* testwebclient.cpp */,
533 DAD1C4CA0AE2C78C0054574C /* stats.h */,
534 DAD1C4CB0AE2C78C0054574C /* stats.cpp */,
535 DAD1C4DC0AE2CA0C0054574C /* llcurl.h */,
536 DAD1C4DD0AE2CA0C0054574C /* llcurl.cpp */,
537 );
538 path = testwebclient;
539 sourceTree = "<group>";
540 };
541 FD15584F0A06BE4100DE9AE5 /* llmessage */ = {
542 isa = PBXGroup;
543 children = (
544 91469E7F0B4486F20009E8F9 /* llmime.cpp */,
545 91469E800B4486F20009E8F9 /* llmime.h */,
546 FDFAD41F0AFFFCC30048A0C7 /* llhttpnode.cpp */,
547 FDFAD4200AFFFCC30048A0C7 /* llhttpnode.h */,
548 FDBC105C0AEEC30000ED2E62 /* llhttpclient.h */,
549 DA306B5B0ACD9F6F008D9B2F /* llhttpclient.cpp */,
550 FD9996A10A1C15AD0057C816 /* llsdhttpserver.cpp */,
551 FD9996A20A1C15AD0057C816 /* llsdhttpserver.h */,
552 386C3F050A14C85000CF4511 /* lliosocket.cpp */,
553 386C3F060A14C85000CF4511 /* lliosocket.h */,
554 FD7326010A08EC490072A37B /* llassetstorage.cpp */,
555 FD7326020A08EC490072A37B /* llassetstorage.h */,
556 FD1558500A06BEB000DE9AE5 /* llbuffer.cpp */,
557 FD1558510A06BEB000DE9AE5 /* llbuffer.h */,
558 FD1558520A06BEB000DE9AE5 /* llbufferstream.cpp */,
559 FD1558530A06BEB000DE9AE5 /* llbufferstream.h */,
560 FD1558880A06BFE400DE9AE5 /* llchainio.cpp */,
561 FD1558890A06BFE400DE9AE5 /* llchainio.h */,
562 FD7325C60A08EB370072A37B /* llcircuit.cpp */,
563 FD7325C70A08EB370072A37B /* llcircuit.h */,
564 FD155F050A08F37900DE9AE5 /* llcrypto.h */,
565 FD73260C0A08ECB70072A37B /* lldatapacker.cpp */,
566 FD73260D0A08ECB70072A37B /* lldatapacker.h */,
567 FD1558770A06BFAB00DE9AE5 /* llfiltersd2xmlrpc.cpp */,
568 FD1558780A06BFAB00DE9AE5 /* llfiltersd2xmlrpc.h */,
569 FD7326110A08ECD90072A37B /* llhost.cpp */,
570 FD7326120A08ECD90072A37B /* llhost.h */,
571 FD1558540A06BEB000DE9AE5 /* llinstantmessage.cpp */,
572 FD1558550A06BEB000DE9AE5 /* llinstantmessage.h */,
573 FD1558790A06BFAB00DE9AE5 /* lliohttpserver.cpp */,
574 FD15587A0A06BFAB00DE9AE5 /* lliohttpserver.h */,
575 FD15587B0A06BFAB00DE9AE5 /* lliopipe.cpp */,
576 FD15587C0A06BFAB00DE9AE5 /* lliopipe.h */,
577 FD1558560A06BEB000DE9AE5 /* llioutil.cpp */,
578 FD1558570A06BEB000DE9AE5 /* llioutil.h */,
579 FD73261A0A08ED580072A37B /* llnamevalue.cpp */,
580 FD73261B0A08ED580072A37B /* llnamevalue.h */,
581 FD155F090A08F60B00DE9AE5 /* llnullcipher.cpp */,
582 FD155F280A08FA0F00DE9AE5 /* llpacketbuffer.cpp */,
583 FD155F290A08FA0F00DE9AE5 /* llpacketbuffer.h */,
584 FD155F1D0A08F9D200DE9AE5 /* llpacketring.cpp */,
585 FD155F1E0A08F9D200DE9AE5 /* llpacketring.h */,
586 FD15587D0A06BFAB00DE9AE5 /* llpumpio.cpp */,
587 FD15587E0A06BFAB00DE9AE5 /* llpumpio.h */,
588 FD1558580A06BEB000DE9AE5 /* llsdrpcclient.cpp */,
589 FD1558590A06BEB000DE9AE5 /* llsdrpcclient.h */,
590 FD15585A0A06BEB000DE9AE5 /* llsdrpcserver.cpp */,
591 FD15585B0A06BEB000DE9AE5 /* llsdrpcserver.h */,
592 FD7325D10A08EB590072A37B /* llthrottle.cpp */,
593 FD7325D20A08EB590072A37B /* llthrottle.h */,
594 FD7325D60A08EB6B0072A37B /* lltransfermanager.cpp */,
595 FD7325D70A08EB6B0072A37B /* lltransfermanager.h */,
596 FD7325DB0A08EB970072A37B /* lltransfersourceasset.cpp */,
597 FD7325DC0A08EB970072A37B /* lltransfersourceasset.h */,
598 FD7325DD0A08EB970072A37B /* lltransfersourcefile.cpp */,
599 FD7325DE0A08EB970072A37B /* lltransfersourcefile.h */,
600 FD7325DF0A08EB970072A37B /* lltransfertargetfile.cpp */,
601 FD7325E00A08EB970072A37B /* lltransfertargetfile.h */,
602 FD7325E10A08EB970072A37B /* lltransfertargetvfile.cpp */,
603 FD7325E20A08EB970072A37B /* lltransfertargetvfile.h */,
604 FD1558950A06C05100DE9AE5 /* llurlrequest.cpp */,
605 FD1558960A06C05100DE9AE5 /* llurlrequest.h */,
606 FD155F3D0A08FAF300DE9AE5 /* llxfer.cpp */,
607 FD155F3E0A08FAF300DE9AE5 /* llxfer.h */,
608 FD155F370A08FAF300DE9AE5 /* llxfer_file.cpp */,
609 FD155F380A08FAF300DE9AE5 /* llxfer_file.h */,
610 FD155F390A08FAF300DE9AE5 /* llxfer_mem.cpp */,
611 FD155F3A0A08FAF300DE9AE5 /* llxfer_mem.h */,
612 FD155F3B0A08FAF300DE9AE5 /* llxfer_vfile.cpp */,
613 FD155F3C0A08FAF300DE9AE5 /* llxfer_vfile.h */,
614 FD155F320A08FAD900DE9AE5 /* llxfermanager.cpp */,
615 FD155F330A08FAD900DE9AE5 /* llxfermanager.h */,
616 FD155F0A0A08F60B00DE9AE5 /* llxorcipher.cpp */,
617 FD155F0E0A08F63200DE9AE5 /* message.cpp */,
618 FD7325B40A08E9B10072A37B /* message.h */,
619 FD7325C80A08EB370072A37B /* message_prehash.cpp */,
620 FD7325C90A08EB370072A37B /* message_prehash.h */,
621 FD155F660A08FD9100DE9AE5 /* message_string_table.cpp */,
622 FD155F2D0A08FA9800DE9AE5 /* net.cpp */,
623 FD155F2E0A08FA9800DE9AE5 /* net.h */,
624 FD7325B30A08E9B10072A37B /* message.cpp */,
625 FD7325B40A08E9B10072A37B /* message.h */,
626 );
627 name = llmessage;
628 path = ../llmessage;
629 sourceTree = "<group>";
630 };
631 FD15589A0A06C07A00DE9AE5 /* System Libraries */ = {
632 isa = PBXGroup;
633 children = (
634 FD155F480A08FB5100DE9AE5 /* Carbon.framework */,
635 FD1558A90A06C14E00DE9AE5 /* libiconv.dylib */,
636 FD15589B0A06C08A00DE9AE5 /* libcurl.dylib */,
637 );
638 name = "System Libraries";
639 sourceTree = "<group>";
640 };
641 FD5DF88009C0A17D007E3F78 /* llcommon */ = {
642 isa = PBXGroup;
643 children = (
644 FDCB2A650AF80D9000C44EBA /* llprocessor.cpp */,
645 FDCB2A660AF80D9000C44EBA /* llprocessor.h */,
646 FDBC10660AEEC3A600ED2E62 /* llpriqueuemap.h */,
647 FDBC10620AEEC39000ED2E62 /* lldefs.h */,
648 FDBC10630AEEC39000ED2E62 /* stdenums.h */,
649 FDBC10640AEEC39000ED2E62 /* string_table.h */,
650 FDBC105F0AEEC33000ED2E62 /* llskipmap.h */,
651 DA306B4B0ACD9EFD008D9B2F /* llcommon.cpp */,
652 DA306B4C0ACD9EFD008D9B2F /* llerrorthread.cpp */,
653 DA306B4D0ACD9EFD008D9B2F /* llrun.cpp */,
654 DA306B480ACD9EBC008D9B2F /* llapp.cpp */,
655 DA306B430ACD9E8B008D9B2F /* llsdutil.cpp */,
656 DA306B440ACD9E8B008D9B2F /* llstreamtools.cpp */,
657 FD5DF88609C0A196007E3F78 /* linden_common.h */,
658 FD5DFAAE09C1E101007E3F78 /* llapr.cpp */,
659 FD7325790A0834080072A37B /* llapr.h */,
660 FD7326050A08EC5B0072A37B /* llassettype.cpp */,
661 FD7326060A08EC5B0072A37B /* llassettype.h */,
662 FD5DFA9009C1DF3E007E3F78 /* lldate.cpp */,
663 FD73257A0A0834080072A37B /* lldate.h */,
664 FD5DFAA809C1E056007E3F78 /* llerror.cpp */,
665 FD73257B0A0834080072A37B /* llerror.h */,
666 FD5DFA9C09C1DFE2007E3F78 /* llerrorbuffer.cpp */,
667 FD73257C0A0834080072A37B /* llerrorbuffer.h */,
668 FD5DFA9E09C1DFE2007E3F78 /* llerrorstream.cpp */,
669 FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */,
670 FD155F600A08FD5900DE9AE5 /* llfasttimer.h */,
671 389CFB450A0B69C700EE2094 /* llfile.cpp */,
672 389CFB440A0B69C700EE2094 /* llfile.h */,
673 FD1558910A06C01400DE9AE5 /* llframetimer.cpp */,
674 FD1558920A06C01400DE9AE5 /* llframetimer.h */,
675 FD155F010A08F36A00DE9AE5 /* llmemory.cpp */,
676 FD155F020A08F36A00DE9AE5 /* llmemory.h */,
677 FD15588C0A06BFF100DE9AE5 /* llmemorystream.cpp */,
678 FD15588D0A06BFF100DE9AE5 /* llmemorystream.h */,
679 FD7325EC0A08EBBF0072A37B /* llqueuedthread.cpp */,
680 FD7325ED0A08EBBF0072A37B /* llqueuedthread.h */,
681 FD5DF9BE09C0A68F007E3F78 /* llsd.cpp */,
682 FD5DF9BF09C0A68F007E3F78 /* llsd.h */,
683 FD506A0409FEB58900E297C2 /* llsdserialize.cpp */,
684 FD506A0509FEB58900E297C2 /* llsdserialize.h */,
685 FD506AA709FFC70100E297C2 /* llsdserialize_xml.cpp */,
686 FD506AA609FFC70100E297C2 /* llsdserialize_xml.h */,
687 FD5DFAB009C1E110007E3F78 /* llstring.cpp */,
688 FD73257D0A0834080072A37B /* llstring.h */,
689 FD155EF80A08F0DE00DE9AE5 /* llstringtable.cpp */,
690 FD155EF90A08F0DE00DE9AE5 /* llstringtable.h */,
691 FD7325FA0A08EC140072A37B /* llthread.cpp */,
692 FD7325FB0A08EC140072A37B /* llthread.h */,
693 FD5DFAB209C1E11A007E3F78 /* lltimer.cpp */,
694 FD73257E0A0834080072A37B /* lltimer.h */,
695 FD5DFA9709C1DFB7007E3F78 /* lluri.cpp */,
696 FD73257F0A0834080072A37B /* lluri.h */,
697 38A8BEAA0A18A2BC00814862 /* metaclass.cpp */,
698 38A8BF140A18A6FF00814862 /* metaclass.h */,
699 38A8BF620A18C31D00814862 /* metaproperty.cpp */,
700 383A14F90A1A1C6700F420F7 /* metapropertyt.h */,
701 38A8BF740A18C42900814862 /* reflective.cpp */,
702 38A8BF690A18C38800814862 /* reflective.h */,
703 FD5DFAB809C1E13A007E3F78 /* u64.cpp */,
704 FD7325800A0834080072A37B /* u64.h */,
705 );
706 name = llcommon;
707 path = ../llcommon;
708 sourceTree = SOURCE_ROOT;
709 };
710 FD5DF9B309C0A550007E3F78 /* Third Party Libs */ = {
711 isa = PBXGroup;
712 children = (
713 FD1558A60A06C0D000DE9AE5 /* libxmlrpc.a */,
714 FD506ADA09FFE09700E297C2 /* libexpat.a */,
715 FD506A2409FEB79700E297C2 /* libaprutil-1.a */,
716 FD5DF9B509C0A571007E3F78 /* libapr-1.a */,
717 );
718 name = "Third Party Libs";
719 sourceTree = "<group>";
720 };
721 FD5DF9CD09C0A72C007E3F78 /* llmath */ = {
722 isa = PBXGroup;
723 children = (
724 91469E8B0B4489420009E8F9 /* llquaternion.cpp */,
725 91469E8C0B4489420009E8F9 /* llquaternion.h */,
726 FD5DFAA509C1E01D007E3F78 /* llmd5.cpp */,
727 FD7326260A08EDA60072A37B /* llmd5.h */,
728 FD5DFAAB09C1E09F007E3F78 /* llrand.cpp */,
729 FD7326220A08ED980072A37B /* llrand.h */,
730 FD5DFA9209C1DF4E007E3F78 /* lluuid.cpp */,
731 FD7326230A08ED980072A37B /* lluuid.h */,
732 FD155EF00A08F0B300DE9AE5 /* m3math.cpp */,
733 FD155EF10A08F0B300DE9AE5 /* m3math.h */,
734 FD155EF20A08F0B300DE9AE5 /* m4math.cpp */,
735 FD155EF30A08F0B300DE9AE5 /* m4math.h */,
736 FD155F220A08F9F600DE9AE5 /* v3math.cpp */,
737 FD155F230A08F9F600DE9AE5 /* v3math.h */,
738 );
739 name = llmath;
740 path = ../llmath;
741 sourceTree = SOURCE_ROOT;
742 };
743 FD73259C0A08E8520072A37B /* llinventory */ = {
744 isa = PBXGroup;
745 children = (
746 FD73259D0A08E8A00072A37B /* llinventory.cpp */,
747 FD73259E0A08E8A00072A37B /* llinventory.h */,
748 FD7325AA0A08E9330072A37B /* llpermissions.cpp */,
749 FD7325AB0A08E9330072A37B /* llpermissions.h */,
750 FD7325AE0A08E95F0072A37B /* llsaleinfo.cpp */,
751 FD7325AF0A08E95F0072A37B /* llsaleinfo.h */,
752 );
753 name = llinventory;
754 path = ../llinventory;
755 sourceTree = "<group>";
756 };
757 FD7325A80A08E8F50072A37B /* llxml */ = {
758 isa = PBXGroup;
759 children = (
760 FD7325A40A08E8F00072A37B /* llxmlnode.cpp */,
761 FD7325A50A08E8F00072A37B /* llxmlnode.h */,
762 );
763 name = llxml;
764 path = ../llxml;
765 sourceTree = "<group>";
766 };
767 FD7325B80A08E9FC0072A37B /* llvfs */ = {
768 isa = PBXGroup;
769 children = (
770 FD7325BB0A08EA220072A37B /* lldir.cpp */,
771 FD7325BC0A08EA220072A37B /* lldir.h */,
772 FD7325B90A08EA220072A37B /* lldir_mac.cpp */,
773 FD7325BA0A08EA220072A37B /* lldir_mac.h */,
774 FD7325BD0A08EA220072A37B /* llvfile.cpp */,
775 FD7325BE0A08EA220072A37B /* llvfile.h */,
776 FD7325F50A08EBE40072A37B /* llvfs.cpp */,
777 FD7325F60A08EBE40072A37B /* llvfs.h */,
778 FD7325F00A08EBD20072A37B /* llvfsthread.cpp */,
779 FD7325F10A08EBD20072A37B /* llvfsthread.h */,
780 );
781 name = llvfs;
782 path = ../llvfs;
783 sourceTree = "<group>";
784 };
785 FDF2E5600ADDBB900003B83E /* testwebserver */ = {
786 isa = PBXGroup;
787 children = (
788 FDF2E5580ADDBB7F0003B83E /* llhttpdelayeddata.cpp */,
789 FDF2E5590ADDBB7F0003B83E /* llhttpdelayeddata.h */,
790 FDF2E55A0ADDBB7F0003B83E /* llwebserver.cpp */,
791 FDF2E55B0ADDBB7F0003B83E /* llwebserver.h */,
792 FDF2E55C0ADDBB7F0003B83E /* testwebserver.cpp */,
793 );
794 path = testwebserver;
795 sourceTree = "<group>";
796 };
797/* End PBXGroup section */
798
799/* Begin PBXNativeTarget section */
800 8DD76F620486A84900D96B5E /* MacTester */ = {
801 isa = PBXNativeTarget;
802 buildConfigurationList = 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "MacTester" */;
803 buildPhases = (
804 8DD76F640486A84900D96B5E /* Sources */,
805 8DD76F660486A84900D96B5E /* Frameworks */,
806 8DD76F690486A84900D96B5E /* CopyFiles */,
807 );
808 buildRules = (
809 );
810 dependencies = (
811 FD5DF9A909C0A537007E3F78 /* PBXTargetDependency */,
812 );
813 name = MacTester;
814 productInstallPath = "$(HOME)/bin";
815 productName = MacTester;
816 productReference = 8DD76F6C0486A84900D96B5E /* MacTester */;
817 productType = "com.apple.product-type.tool";
818 };
819 DA01B1C40ADE82C400A44198 /* TestWebClient */ = {
820 isa = PBXNativeTarget;
821 buildConfigurationList = DA01B1EC0ADE82C400A44198 /* Build configuration list for PBXNativeTarget "TestWebClient" */;
822 buildPhases = (
823 DA01B1C70ADE82C400A44198 /* Sources */,
824 DA01B1E80ADE82C400A44198 /* Frameworks */,
825 );
826 buildRules = (
827 );
828 dependencies = (
829 DA01B1C50ADE82C400A44198 /* PBXTargetDependency */,
830 );
831 name = TestWebClient;
832 productName = TestWebServer;
833 productReference = DA01B1EF0ADE82C400A44198 /* TestWebClient */;
834 productType = "com.apple.product-type.tool";
835 };
836 FDF2E4170ADD7B620003B83E /* TestWebServer */ = {
837 isa = PBXNativeTarget;
838 buildConfigurationList = FDF2E41E0ADD7B8D0003B83E /* Build configuration list for PBXNativeTarget "TestWebServer" */;
839 buildPhases = (
840 FDF2E4150ADD7B620003B83E /* Sources */,
841 FDF2E4160ADD7B620003B83E /* Frameworks */,
842 );
843 buildRules = (
844 );
845 dependencies = (
846 FDF2E41B0ADD7B690003B83E /* PBXTargetDependency */,
847 );
848 name = TestWebServer;
849 productName = TestWebServer;
850 productReference = FDF2E4180ADD7B620003B83E /* TestWebServer */;
851 productType = "com.apple.product-type.tool";
852 };
853/* End PBXNativeTarget section */
854
855/* Begin PBXProject section */
856 08FB7793FE84155DC02AAC07 /* Project object */ = {
857 isa = PBXProject;
858 buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "MacTester" */;
859 hasScannedForEncodings = 1;
860 mainGroup = 08FB7794FE84155DC02AAC07 /* MacTester */;
861 projectDirPath = "";
862 targets = (
863 FD5DF9A109C0A4F5007E3F78 /* third party libs */,
864 8DD76F620486A84900D96B5E /* MacTester */,
865 FDF2E4170ADD7B620003B83E /* TestWebServer */,
866 DA01B1C40ADE82C400A44198 /* TestWebClient */,
867 );
868 };
869/* End PBXProject section */
870
871/* Begin PBXShellScriptBuildPhase section */
872 FD5DF9A009C0A4F5007E3F78 /* ShellScript */ = {
873 isa = PBXShellScriptBuildPhase;
874 buildActionMask = 2147483647;
875 files = (
876 );
877 inputPaths = (
878 );
879 outputPaths = (
880 );
881 runOnlyForDeploymentPostprocessing = 0;
882 shellPath = /bin/sh;
883 shellScript = "LIBS=\"apr-1 aprutil-1 expat xmlrpc\"\nLIBDIR=\"${SRCROOT}/../../libraries\"\n\ncd \"${LIBDIR}\"\n\nif [ \\! -e ppc-darwin ]\nthen\n\tln -s powerpc-darwin ppc-darwin\nfi\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}\"\n\nfor i in ${LIBS}; do\n\tIN_i386=\"i386-darwin/lib_release/lib$i.a\"\n\tIN_ppc=\"ppc-darwin/lib_release/lib$i.a\"\n\tOUT=\"${BUILT_PRODUCTS_DIR}/lib$i.a\"\necho out is $OUT\necho in is $IN_i386 and $IN_ppc\n\n\tif [ \"$IN_i386\" -nt \"$OUT\" -o \"$IN_ppc\" -nt \"$OUT\" ]; then\n\t\techo lib$i.a building via libtool\n#\t\techo libtool -static -o \"$OUT\" \"$IN_i386\" \"$IN_ppc\"\n\t\tlibtool -static -o \"$OUT\" \"$IN_i386\" \"$IN_ppc\"\n\telse\n\t\techo lib$i.a up to date\n\tfi\ndone\n";
884 };
885/* End PBXShellScriptBuildPhase section */
886
887/* Begin PBXSourcesBuildPhase section */
888 8DD76F640486A84900D96B5E /* Sources */ = {
889 isa = PBXSourcesBuildPhase;
890 buildActionMask = 2147483647;
891 files = (
892 FD5DF87B09C0A0FB007E3F78 /* test.cpp in Sources */,
893 FD5DF9F609C0E20E007E3F78 /* llsd_new_tut.cpp in Sources */,
894 FD5DFA9109C1DF3E007E3F78 /* lldate.cpp in Sources */,
895 FD5DFA9309C1DF4E007E3F78 /* lluuid.cpp in Sources */,
896 FD5DFA9909C1DFB7007E3F78 /* lluri.cpp in Sources */,
897 FD5DFAA009C1DFE2007E3F78 /* llerrorbuffer.cpp in Sources */,
898 FD5DFAA209C1DFE2007E3F78 /* llerrorstream.cpp in Sources */,
899 FD5DFAA609C1E01D007E3F78 /* llmd5.cpp in Sources */,
900 FD5DFAA909C1E056007E3F78 /* llerror.cpp in Sources */,
901 FD5DFAAC09C1E09F007E3F78 /* llrand.cpp in Sources */,
902 FD5DFAAF09C1E101007E3F78 /* llapr.cpp in Sources */,
903 FD5DFAB109C1E110007E3F78 /* llstring.cpp in Sources */,
904 FD5DFAB309C1E11A007E3F78 /* lltimer.cpp in Sources */,
905 FD5DFAB909C1E13A007E3F78 /* u64.cpp in Sources */,
906 FDEC4F5509F7EF7A007BAEEC /* llsd.cpp in Sources */,
907 FD506A0609FEB58900E297C2 /* llsdserialize.cpp in Sources */,
908 FD506A2F09FEC37900E297C2 /* llsdserialize_tut.cpp in Sources */,
909 FD506AA909FFC70100E297C2 /* llsdserialize_xml.cpp in Sources */,
910 FD15584D0A06BE2E00DE9AE5 /* io.cpp in Sources */,
911 FD15585C0A06BEB000DE9AE5 /* llbuffer.cpp in Sources */,
912 FD15585E0A06BEB000DE9AE5 /* llbufferstream.cpp in Sources */,
913 FD1558600A06BEB000DE9AE5 /* llinstantmessage.cpp in Sources */,
914 FD1558620A06BEB000DE9AE5 /* llioutil.cpp in Sources */,
915 FD1558640A06BEB000DE9AE5 /* llsdrpcclient.cpp in Sources */,
916 FD1558660A06BEB000DE9AE5 /* llsdrpcserver.cpp in Sources */,
917 FD15587F0A06BFAB00DE9AE5 /* llfiltersd2xmlrpc.cpp in Sources */,
918 FD1558810A06BFAB00DE9AE5 /* lliohttpserver.cpp in Sources */,
919 FD1558830A06BFAB00DE9AE5 /* lliopipe.cpp in Sources */,
920 FD1558850A06BFAB00DE9AE5 /* llpumpio.cpp in Sources */,
921 FD15588A0A06BFE400DE9AE5 /* llchainio.cpp in Sources */,
922 FD15588E0A06BFF100DE9AE5 /* llmemorystream.cpp in Sources */,
923 FD1558930A06C01400DE9AE5 /* llframetimer.cpp in Sources */,
924 FD1558970A06C05100DE9AE5 /* llurlrequest.cpp in Sources */,
925 FD7325940A08E7A60072A37B /* common.cpp in Sources */,
926 FD7325970A08E8260072A37B /* math.cpp in Sources */,
927 FD73259A0A08E8420072A37B /* inventory.cpp in Sources */,
928 FD73259F0A08E8A00072A37B /* llinventory.cpp in Sources */,
929 FD7325A60A08E8F00072A37B /* llxmlnode.cpp in Sources */,
930 FD7325AC0A08E9330072A37B /* llpermissions.cpp in Sources */,
931 FD7325B00A08E95F0072A37B /* llsaleinfo.cpp in Sources */,
932 FD7325BF0A08EA220072A37B /* lldir_mac.cpp in Sources */,
933 FD7325C10A08EA220072A37B /* lldir.cpp in Sources */,
934 FD7325C30A08EA220072A37B /* llvfile.cpp in Sources */,
935 FD7325CA0A08EB370072A37B /* llcircuit.cpp in Sources */,
936 FD7325CC0A08EB370072A37B /* message_prehash.cpp in Sources */,
937 FD7325D30A08EB590072A37B /* llthrottle.cpp in Sources */,
938 FD7325D80A08EB6B0072A37B /* lltransfermanager.cpp in Sources */,
939 FD7325E30A08EB970072A37B /* lltransfersourceasset.cpp in Sources */,
940 FD7325E50A08EB970072A37B /* lltransfersourcefile.cpp in Sources */,
941 FD7325E70A08EB970072A37B /* lltransfertargetfile.cpp in Sources */,
942 FD7325E90A08EB970072A37B /* lltransfertargetvfile.cpp in Sources */,
943 FD7325EE0A08EBBF0072A37B /* llqueuedthread.cpp in Sources */,
944 FD7325F20A08EBD20072A37B /* llvfsthread.cpp in Sources */,
945 FD7325F70A08EBE40072A37B /* llvfs.cpp in Sources */,
946 FD7325FC0A08EC140072A37B /* llthread.cpp in Sources */,
947 FD7326030A08EC490072A37B /* llassetstorage.cpp in Sources */,
948 FD7326070A08EC5B0072A37B /* llassettype.cpp in Sources */,
949 FD73260E0A08ECB70072A37B /* lldatapacker.cpp in Sources */,
950 FD7326130A08ECD90072A37B /* llhost.cpp in Sources */,
951 FD73261C0A08ED580072A37B /* llnamevalue.cpp in Sources */,
952 FD155EF40A08F0B300DE9AE5 /* m3math.cpp in Sources */,
953 FD155EF60A08F0B300DE9AE5 /* m4math.cpp in Sources */,
954 FD155EFA0A08F0DE00DE9AE5 /* llstringtable.cpp in Sources */,
955 FD155F030A08F36A00DE9AE5 /* llmemory.cpp in Sources */,
956 FD155F0B0A08F60B00DE9AE5 /* llnullcipher.cpp in Sources */,
957 FD155F0C0A08F60B00DE9AE5 /* llxorcipher.cpp in Sources */,
958 FD155F100A08F63200DE9AE5 /* message.cpp in Sources */,
959 FD155F1F0A08F9D200DE9AE5 /* llpacketring.cpp in Sources */,
960 FD155F240A08F9F600DE9AE5 /* v3math.cpp in Sources */,
961 FD155F2A0A08FA0F00DE9AE5 /* llpacketbuffer.cpp in Sources */,
962 FD155F2F0A08FA9800DE9AE5 /* net.cpp in Sources */,
963 FD155F340A08FAD900DE9AE5 /* llxfermanager.cpp in Sources */,
964 FD155F3F0A08FAF300DE9AE5 /* llxfer_file.cpp in Sources */,
965 FD155F410A08FAF300DE9AE5 /* llxfer_mem.cpp in Sources */,
966 FD155F430A08FAF300DE9AE5 /* llxfer_vfile.cpp in Sources */,
967 FD155F450A08FAF300DE9AE5 /* llxfer.cpp in Sources */,
968 FD155F610A08FD5900DE9AE5 /* llfasttimer.cpp in Sources */,
969 FD155F670A08FD9100DE9AE5 /* message_string_table.cpp in Sources */,
970 389CFB470A0B69C700EE2094 /* llfile.cpp in Sources */,
971 386C3F070A14C85000CF4511 /* lliosocket.cpp in Sources */,
972 38A8BEAB0A18A2BC00814862 /* metaclass.cpp in Sources */,
973 38A8BF630A18C31D00814862 /* metaproperty.cpp in Sources */,
974 38A8BF750A18C42900814862 /* reflective.cpp in Sources */,
975 FDFBED130A1B591B0056E81E /* lliohttpserver_tut.cpp in Sources */,
976 FD9996A30A1C15B10057C816 /* llsdhttpserver.cpp in Sources */,
977 FD9996D80A1CA7570057C816 /* llpipeutil.cpp in Sources */,
978 FD396CDD0A1D37DF005DCB1F /* lltut.cpp in Sources */,
979 FD396D160A1DFB4B005DCB1F /* reflection_tut.cpp in Sources */,
980 DA306B450ACD9E8B008D9B2F /* llsdutil.cpp in Sources */,
981 DA306B460ACD9E8B008D9B2F /* llstreamtools.cpp in Sources */,
982 DA306B490ACD9EBC008D9B2F /* llapp.cpp in Sources */,
983 DA306B4E0ACD9EFD008D9B2F /* llcommon.cpp in Sources */,
984 DA306B4F0ACD9EFD008D9B2F /* llerrorthread.cpp in Sources */,
985 DA306B500ACD9EFD008D9B2F /* llrun.cpp in Sources */,
986 DA306B560ACD9F3F008D9B2F /* llapp_tut.cpp in Sources */,
987 DA306B570ACD9F3F008D9B2F /* llhttpclient_tut.cpp in Sources */,
988 DA306B580ACD9F3F008D9B2F /* lltiming_tut.cpp in Sources */,
989 DA306B590ACD9F3F008D9B2F /* lluri_tut.cpp in Sources */,
990 DA306B5C0ACD9F6F008D9B2F /* llhttpclient.cpp in Sources */,
991 FDCB2A670AF80D9000C44EBA /* llprocessor.cpp in Sources */,
992 FDFAD4210AFFFCC30048A0C7 /* llhttpnode.cpp in Sources */,
993 91469E810B4486F20009E8F9 /* llmime.cpp in Sources */,
994 91469E840B44870B0009E8F9 /* llmime_tut.cpp in Sources */,
995 91469E8D0B4489420009E8F9 /* llquaternion.cpp in Sources */,
996 );
997 runOnlyForDeploymentPostprocessing = 0;
998 };
999 DA01B1C70ADE82C400A44198 /* Sources */ = {
1000 isa = PBXSourcesBuildPhase;
1001 buildActionMask = 2147483647;
1002 files = (
1003 DAD1C4CC0AE2C78C0054574C /* stats.cpp in Sources */,
1004 DAD1C4DE0AE2CA0C0054574C /* llcurl.cpp in Sources */,
1005 FDBC106D0AEEC3DA00ED2E62 /* llsd.cpp in Sources */,
1006 FDBC106F0AEEC3E900ED2E62 /* lluuid.cpp in Sources */,
1007 FDBC10710AEEC3F800ED2E62 /* llsdserialize.cpp in Sources */,
1008 FDBC10720AEEC3F900ED2E62 /* llsdserialize_xml.cpp in Sources */,
1009 FDBC10750AEEC41600ED2E62 /* lldate.cpp in Sources */,
1010 FDBC10760AEEC41B00ED2E62 /* llmd5.cpp in Sources */,
1011 FDBC10790AEEC42B00ED2E62 /* llerrorstream.cpp in Sources */,
1012 FDBC107A0AEEC42C00ED2E62 /* llerrorbuffer.cpp in Sources */,
1013 FDBC107B0AEEC43200ED2E62 /* lluri.cpp in Sources */,
1014 FDBC107E0AEEC45100ED2E62 /* lltimer.cpp in Sources */,
1015 FDBC107F0AEEC45400ED2E62 /* llfasttimer.cpp in Sources */,
1016 FDBC10810AEEC46D00ED2E62 /* llapr.cpp in Sources */,
1017 FDBC10860AEEC49800ED2E62 /* lliopipe.cpp in Sources */,
1018 FDBC10870AEEC49D00ED2E62 /* llpumpio.cpp in Sources */,
1019 FDBC10890AEEC4BA00ED2E62 /* llurlrequest.cpp in Sources */,
1020 FDBC108B0AEEC4CD00ED2E62 /* llbuffer.cpp in Sources */,
1021 FDBC108D0AEEC4E500ED2E62 /* llstring.cpp in Sources */,
1022 FDBC108F0AEEC50200ED2E62 /* u64.cpp in Sources */,
1023 FDBC10900AEEC50A00ED2E62 /* llmemory.cpp in Sources */,
1024 FDBC10990AEEC57D00ED2E62 /* llhttpclient.cpp in Sources */,
1025 FDBC109D0AEEC5EE00ED2E62 /* llbufferstream.cpp in Sources */,
1026 FDBC109F0AEEC5FB00ED2E62 /* llchainio.cpp in Sources */,
1027 FDBC10A10AEEC60F00ED2E62 /* llioutil.cpp in Sources */,
1028 FDBC10A30AEEC62400ED2E62 /* llthread.cpp in Sources */,
1029 FDBC10A50AEEC63200ED2E62 /* llerror.cpp in Sources */,
1030 FDBC10A70AEEC64100ED2E62 /* llrand.cpp in Sources */,
1031 FDBC10A90AEEC65700ED2E62 /* llstreamtools.cpp in Sources */,
1032 FDBC10AB0AEEC66100ED2E62 /* testwebclient.cpp in Sources */,
1033 FDBC10AD0AEEC67700ED2E62 /* llframetimer.cpp in Sources */,
1034 );
1035 runOnlyForDeploymentPostprocessing = 0;
1036 };
1037 FDF2E4150ADD7B620003B83E /* Sources */ = {
1038 isa = PBXSourcesBuildPhase;
1039 buildActionMask = 2147483647;
1040 files = (
1041 );
1042 runOnlyForDeploymentPostprocessing = 0;
1043 };
1044/* End PBXSourcesBuildPhase section */
1045
1046/* Begin PBXTargetDependency section */
1047 DA01B1C50ADE82C400A44198 /* PBXTargetDependency */ = {
1048 isa = PBXTargetDependency;
1049 target = FD5DF9A109C0A4F5007E3F78 /* third party libs */;
1050 targetProxy = FDBC10510AEEB7C300ED2E62 /* PBXContainerItemProxy */;
1051 };
1052 FD5DF9A909C0A537007E3F78 /* PBXTargetDependency */ = {
1053 isa = PBXTargetDependency;
1054 target = FD5DF9A109C0A4F5007E3F78 /* third party libs */;
1055 targetProxy = FD5DF9A809C0A537007E3F78 /* PBXContainerItemProxy */;
1056 };
1057 FDF2E41B0ADD7B690003B83E /* PBXTargetDependency */ = {
1058 isa = PBXTargetDependency;
1059 target = FD5DF9A109C0A4F5007E3F78 /* third party libs */;
1060 targetProxy = FDBC10500AEEB7C300ED2E62 /* PBXContainerItemProxy */;
1061 };
1062/* End PBXTargetDependency section */
1063
1064/* Begin XCBuildConfiguration section */
1065 1DEB923208733DC60010E9CD /* Debug */ = {
1066 isa = XCBuildConfiguration;
1067 buildSettings = {
1068 INSTALL_PATH = "$(HOME)/bin";
1069 PRODUCT_NAME = MacTester;
1070 };
1071 name = Debug;
1072 };
1073 1DEB923308733DC60010E9CD /* Release */ = {
1074 isa = XCBuildConfiguration;
1075 buildSettings = {
1076 ARCHS = (
1077 ppc,
1078 i386,
1079 );
1080 INSTALL_PATH = "$(HOME)/bin";
1081 PRODUCT_NAME = MacTester;
1082 };
1083 name = Release;
1084 };
1085 1DEB923608733DC60010E9CD /* Debug */ = {
1086 isa = XCBuildConfiguration;
1087 buildSettings = {
1088 GCC_ALTIVEC_EXTENSIONS = YES;
1089 GCC_OPTIMIZATION_LEVEL = 1;
1090 GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
1091 HEADER_SEARCH_PATHS = (
1092 "../../libraries/$(arch)-darwin/include",
1093 ../../libraries/include,
1094 ../llcommon,
1095 );
1096 OTHER_CFLAGS = (
1097 "-DLL_DARWIN=1",
1098 "-DLL_DEBUG=1",
1099 "-D_DEBUG",
1100 "-fconstant-cfstrings",
1101 );
1102 OTHER_CPLUSPLUSFLAGS = (
1103 "$(OTHER_CFLAGS)",
1104 "-ffor-scope",
1105 "-Wno-reorder",
1106 );
1107 PREBINDING = NO;
1108 WARNING_CFLAGS = (
1109 "-Wmost",
1110 "-Wno-sign-compare",
1111 "-Wno-switch",
1112 );
1113 };
1114 name = Debug;
1115 };
1116 1DEB923708733DC60010E9CD /* Release */ = {
1117 isa = XCBuildConfiguration;
1118 buildSettings = {
1119 GCC_ALTIVEC_EXTENSIONS = YES;
1120 GCC_OPTIMIZATION_LEVEL = 3;
1121 GCC_PREPROCESSOR_DEFINITIONS = "LL_DARWIN=1";
1122 GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
1123 HEADER_SEARCH_PATHS = (
1124 "../../libraries/$(arch)-darwin/include",
1125 ../../libraries/include,
1126 ../llcommon,
1127 );
1128 OTHER_CFLAGS = (
1129 "-DLL_DARWIN=1",
1130 "-DLL_RELEASE=1",
1131 "-DLL_RELEASE_FOR_DOWNLOAD=1",
1132 "-DNDEBUG",
1133 "-fconstant-cfstrings",
1134 );
1135 OTHER_CPLUSPLUSFLAGS = (
1136 "$(OTHER_CFLAGS)",
1137 "-ffor-scope",
1138 "-Wno-reorder",
1139 );
1140 PREBINDING = NO;
1141 WARNING_CFLAGS = (
1142 "-Wmost",
1143 "-Wno-sign-compare",
1144 "-Wno-switch",
1145 );
1146 };
1147 name = Release;
1148 };
1149 DA01B1ED0ADE82C400A44198 /* Debug */ = {
1150 isa = XCBuildConfiguration;
1151 buildSettings = {
1152 COPY_PHASE_STRIP = NO;
1153 GCC_DYNAMIC_NO_PIC = NO;
1154 GCC_ENABLE_FIX_AND_CONTINUE = YES;
1155 GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
1156 GCC_MODEL_TUNING = G5;
1157 GCC_OPTIMIZATION_LEVEL = 0;
1158 GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES;
1159 HEADER_SEARCH_PATHS = (
1160 "${PROJECT_DIR}/../../libraries/${CURRENT_ARCH}-darwin/include",
1161 "${PROJECT_DIR}/../../libraries/include",
1162 );
1163 INSTALL_PATH = "$(HOME)/bin";
1164 LIBRARY_SEARCH_PATHS = (
1165 "$(inherited)",
1166 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
1167 "$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
1168 );
1169 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Debug\"";
1170 LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/build/Debug\"";
1171 PREBINDING = NO;
1172 PRODUCT_NAME = TestWebClient;
1173 ZERO_LINK = YES;
1174 };
1175 name = Debug;
1176 };
1177 DA01B1EE0ADE82C400A44198 /* Release */ = {
1178 isa = XCBuildConfiguration;
1179 buildSettings = {
1180 COPY_PHASE_STRIP = YES;
1181 GCC_ENABLE_FIX_AND_CONTINUE = NO;
1182 GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
1183 GCC_MODEL_TUNING = G5;
1184 GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES;
1185 HEADER_SEARCH_PATHS = (
1186 "${PROJECT_DIR}/../../libraries/${CURRENT_ARCH}-darwin/include",
1187 "${PROJECT_DIR}/../../libraries/include",
1188 );
1189 INSTALL_PATH = "$(HOME)/bin";
1190 LIBRARY_SEARCH_PATHS = (
1191 "$(inherited)",
1192 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
1193 "$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
1194 );
1195 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Debug\"";
1196 LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/build/Debug\"";
1197 PREBINDING = NO;
1198 PRODUCT_NAME = TestWebClient;
1199 ZERO_LINK = NO;
1200 };
1201 name = Release;
1202 };
1203 FD5DF9A309C0A51D007E3F78 /* Debug */ = {
1204 isa = XCBuildConfiguration;
1205 buildSettings = {
1206 COPY_PHASE_STRIP = NO;
1207 GCC_DYNAMIC_NO_PIC = NO;
1208 GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
1209 GCC_OPTIMIZATION_LEVEL = 0;
1210 PRODUCT_NAME = "third party libs";
1211 };
1212 name = Debug;
1213 };
1214 FD5DF9A409C0A51D007E3F78 /* Release */ = {
1215 isa = XCBuildConfiguration;
1216 buildSettings = {
1217 COPY_PHASE_STRIP = YES;
1218 GCC_ENABLE_FIX_AND_CONTINUE = NO;
1219 GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
1220 PRODUCT_NAME = "third party libs";
1221 ZERO_LINK = NO;
1222 };
1223 name = Release;
1224 };
1225 FDF2E41F0ADD7B8D0003B83E /* Debug */ = {
1226 isa = XCBuildConfiguration;
1227 buildSettings = {
1228 COPY_PHASE_STRIP = NO;
1229 GCC_DYNAMIC_NO_PIC = NO;
1230 GCC_ENABLE_FIX_AND_CONTINUE = YES;
1231 GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
1232 GCC_MODEL_TUNING = G5;
1233 GCC_OPTIMIZATION_LEVEL = 0;
1234 GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES;
1235 HEADER_SEARCH_PATHS = (
1236 "${PROJECT_DIR}/../../libraries/${CURRENT_ARCH}-darwin/include",
1237 "${PROJECT_DIR}/../../libraries/include",
1238 );
1239 INSTALL_PATH = "$(HOME)/bin";
1240 LIBRARY_SEARCH_PATHS = (
1241 "$(inherited)",
1242 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
1243 );
1244 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Debug\"";
1245 PREBINDING = NO;
1246 PRODUCT_NAME = TestWebServer;
1247 ZERO_LINK = YES;
1248 };
1249 name = Debug;
1250 };
1251 FDF2E4200ADD7B8D0003B83E /* Release */ = {
1252 isa = XCBuildConfiguration;
1253 buildSettings = {
1254 COPY_PHASE_STRIP = YES;
1255 GCC_ENABLE_FIX_AND_CONTINUE = NO;
1256 GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
1257 GCC_MODEL_TUNING = G5;
1258 GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES;
1259 HEADER_SEARCH_PATHS = (
1260 "${PROJECT_DIR}/../../libraries/${CURRENT_ARCH}-darwin/include",
1261 "${PROJECT_DIR}/../../libraries/include",
1262 );
1263 INSTALL_PATH = "$(HOME)/bin";
1264 LIBRARY_SEARCH_PATHS = (
1265 "$(inherited)",
1266 "$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
1267 );
1268 LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Debug\"";
1269 PREBINDING = NO;
1270 PRODUCT_NAME = TestWebServer;
1271 ZERO_LINK = NO;
1272 };
1273 name = Release;
1274 };
1275/* End XCBuildConfiguration section */
1276
1277/* Begin XCConfigurationList section */
1278 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "MacTester" */ = {
1279 isa = XCConfigurationList;
1280 buildConfigurations = (
1281 1DEB923208733DC60010E9CD /* Debug */,
1282 1DEB923308733DC60010E9CD /* Release */,
1283 );
1284 defaultConfigurationIsVisible = 0;
1285 defaultConfigurationName = Release;
1286 };
1287 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "MacTester" */ = {
1288 isa = XCConfigurationList;
1289 buildConfigurations = (
1290 1DEB923608733DC60010E9CD /* Debug */,
1291 1DEB923708733DC60010E9CD /* Release */,
1292 );
1293 defaultConfigurationIsVisible = 0;
1294 defaultConfigurationName = Release;
1295 };
1296 DA01B1EC0ADE82C400A44198 /* Build configuration list for PBXNativeTarget "TestWebClient" */ = {
1297 isa = XCConfigurationList;
1298 buildConfigurations = (
1299 DA01B1ED0ADE82C400A44198 /* Debug */,
1300 DA01B1EE0ADE82C400A44198 /* Release */,
1301 );
1302 defaultConfigurationIsVisible = 0;
1303 defaultConfigurationName = Release;
1304 };
1305 FD5DF9A209C0A51D007E3F78 /* Build configuration list for PBXAggregateTarget "third party libs" */ = {
1306 isa = XCConfigurationList;
1307 buildConfigurations = (
1308 FD5DF9A309C0A51D007E3F78 /* Debug */,
1309 FD5DF9A409C0A51D007E3F78 /* Release */,
1310 );
1311 defaultConfigurationIsVisible = 0;
1312 defaultConfigurationName = Release;
1313 };
1314 FDF2E41E0ADD7B8D0003B83E /* Build configuration list for PBXNativeTarget "TestWebServer" */ = {
1315 isa = XCConfigurationList;
1316 buildConfigurations = (
1317 FDF2E41F0ADD7B8D0003B83E /* Debug */,
1318 FDF2E4200ADD7B8D0003B83E /* Release */,
1319 );
1320 defaultConfigurationIsVisible = 0;
1321 defaultConfigurationName = Release;
1322 };
1323/* End XCConfigurationList section */
1324 };
1325 rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
1326}
diff --git a/linden/indra/test/common.cpp b/linden/indra/test/common.cpp
new file mode 100644
index 0000000..1be0931
--- /dev/null
+++ b/linden/indra/test/common.cpp
@@ -0,0 +1,447 @@
1/**
2 * @file common.cpp
3 * @author Phoenix
4 * @date 2005-10-12
5 * @brief Common templates for test framework
6 *
7 * Copyright (c) 2005-2007, Linden Research, Inc.
8 *
9 * The source code in this file ("Source Code") is provided by Linden Lab
10 * to you under the terms of the GNU General Public License, version 2.0
11 * ("GPL"), unless you have obtained a separate licensing agreement
12 * ("Other License"), formally executed by you and Linden Lab. Terms of
13 * the GPL can be found in doc/GPL-license.txt in this distribution, or
14 * online at http://secondlife.com/developers/opensource/gplv2
15 *
16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlife.com/developers/opensource/flossexception
20 *
21 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above,
23 * and agree to abide by those obligations.
24 *
25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27 * COMPLETENESS OR PERFORMANCE.
28 */
29
30/**
31 *
32 * THOROUGH_DESCRIPTION of common.cpp
33 *
34 */
35
36#include "linden_common.h"
37#include "lltut.h"
38
39#include <algorithm>
40#include <iomanip>
41#include <iterator>
42
43#include "llmemorystream.h"
44#include "llsd.h"
45#include "llsdserialize.h"
46
47namespace tut
48{
49 struct sd_data
50 {
51 };
52 typedef test_group<sd_data> sd_test;
53 typedef sd_test::object sd_object;
54 tut::sd_test sd("llsd");
55
56 template<> template<>
57 void sd_object::test<1>()
58 {
59 std::ostringstream resp;
60 resp << "{'connect':true, 'position':[r128,r128,r128], 'look_at':[r0,r1,r0], 'agent_access':'M', 'region_x':i8192, 'region_y':i8192}";
61 std::string str = resp.str();
62 LLMemoryStream mstr((U8*)str.c_str(), str.size());
63 LLSD response;
64 S32 count = LLSDSerialize::fromNotation(response, mstr);
65 ensure("stream parsed", response.isDefined());
66 ensure_equals("stream parse count", count, 13);
67 ensure_equals("sd type", response.type(), LLSD::TypeMap);
68 ensure_equals("map element count", response.size(), 6);
69 ensure_equals("value connect", response["connect"].asBoolean(), true);
70 ensure_equals("value region_x", response["region_x"].asInteger(),8192);
71 ensure_equals("value region_y", response["region_y"].asInteger(),8192);
72 }
73
74 template<> template<>
75 void sd_object::test<2>()
76 {
77 const std::string decoded("random");
78 //const std::string encoded("cmFuZG9t\n");
79 const std::string streamed("b(6)\"random\"");
80 typedef std::vector<U8> buf_t;
81 buf_t buf;
82 std::copy(
83 decoded.begin(),
84 decoded.end(),
85 std::back_insert_iterator<buf_t>(buf));
86 LLSD sd;
87 sd = buf;
88 std::stringstream str;
89 S32 count = LLSDSerialize::toNotation(sd, str);
90 ensure_equals("output count", count, 1);
91 std::string actual(str.str());
92 ensure_equals("formatted binary encoding", actual, streamed);
93 sd.clear();
94 LLSDSerialize::fromNotation(sd, str);
95 std::vector<U8> after;
96 after = sd.asBinary();
97 ensure_equals("binary decoded size", after.size(), decoded.size());
98 ensure("binary decoding", (0 == memcmp(
99 &after[0],
100 decoded.c_str(),
101 decoded.size())));
102 }
103
104 template<> template<>
105 void sd_object::test<3>()
106 {
107 for(S32 i = 0; i < 100; ++i)
108 {
109 // gen up a starting point
110 typedef std::vector<U8> buf_t;
111 buf_t source;
112 srand(i);
113 S32 size = rand() % 1000 + 10;
114 std::generate_n(
115 std::back_insert_iterator<buf_t>(source),
116 size,
117 rand);
118 LLSD sd(source);
119 std::stringstream str;
120 S32 count = LLSDSerialize::toNotation(sd, str);
121 sd.clear();
122 ensure_equals("format count", count, 1);
123 LLSD sd2;
124 count = LLSDSerialize::fromNotation(sd2, str);
125 ensure_equals("parse count", count, 1);
126 buf_t dest = sd2.asBinary();
127 str.str("");
128 str << "binary encoding size " << i;
129 ensure_equals(str.str().c_str(), dest.size(), source.size());
130 str.str("");
131 str << "binary encoding " << i;
132 ensure(str.str().c_str(), (source == dest));
133 }
134 }
135
136 template<> template<>
137 void sd_object::test<4>()
138 {
139 std::ostringstream ostr;
140 ostr << "{'task_id':u1fd77b79-a8e7-25a5-9454-02a4d948ba1c}\n"
141 << "{\n\tname\tObject|\n}\n";
142 std::string expected = ostr.str();
143 std::stringstream serialized;
144 serialized << "'" << LLSDNotationFormatter::escapeString(expected)
145 << "'";
146 LLSD sd;
147 S32 count = LLSDSerialize::fromNotation(sd, serialized);
148 ensure_equals("parse count", count, 1);
149 ensure_equals("String streaming", sd.asString(), expected);
150 }
151
152 template<> template<>
153 void sd_object::test<5>()
154 {
155 for(S32 i = 0; i < 100; ++i)
156 {
157 // gen up a starting point
158 typedef std::vector<U8> buf_t;
159 buf_t source;
160 srand(666 + i);
161 S32 size = rand() % 1000 + 10;
162 std::generate_n(
163 std::back_insert_iterator<buf_t>(source),
164 size,
165 rand);
166 std::stringstream str;
167 str << "b(" << size << ")\"";
168 str.write((const char*)&source[0], size);
169 str << "\"";
170 LLSD sd;
171 S32 count = LLSDSerialize::fromNotation(sd, str);
172 ensure_equals("binary parse", count, 1);
173 buf_t actual = sd.asBinary();
174 ensure_equals("binary size", actual.size(), (size_t)size);
175 ensure("binary data", (0 == memcmp(&source[0], &actual[0], size)));
176 }
177 }
178
179 template<> template<>
180 void sd_object::test<6>()
181 {
182 std::string expected("'{\"task_id\":u1fd77b79-a8e7-25a5-9454-02a4d948ba1c}'\t\n\t\t");
183 std::stringstream str;
184 str << "s(" << expected.size() << ")'";
185 str.write(expected.c_str(), expected.size());
186 str << "'";
187 LLSD sd;
188 S32 count = LLSDSerialize::fromNotation(sd, str);
189 ensure_equals("parse count", count, 1);
190 std::string actual = sd.asString();
191 ensure_equals("string sizes", actual.size(), expected.size());
192 ensure_equals("string content", actual, expected);
193 }
194
195 template<> template<>
196 void sd_object::test<7>()
197 {
198 std::string msg("come on in");
199 std::stringstream stream;
200 stream << "{'connect':1, 'message':'" << msg << "',"
201 << " 'position':[r45.65,r100.1,r25.5],"
202 << " 'look_at':[r0,r1,r0],"
203 << " 'agent_access':'PG'}";
204 LLSD sd;
205 S32 count = LLSDSerialize::fromNotation(sd, stream);
206 ensure_equals("parse count", count, 12);
207 ensure_equals("bool value", sd["connect"].asBoolean(), true);
208 ensure_equals("message value", sd["message"].asString(), msg);
209 ensure_equals("pos x", sd["position"][0].asReal(), 45.65);
210 ensure_equals("pos y", sd["position"][1].asReal(), 100.1);
211 ensure_equals("pos z", sd["position"][2].asReal(), 25.5);
212 ensure_equals("look x", sd["look_at"][0].asReal(), 0.0);
213 ensure_equals("look y", sd["look_at"][1].asReal(), 1.0);
214 ensure_equals("look z", sd["look_at"][2].asReal(), 0.0);
215 }
216
217 template<> template<>
218 void sd_object::test<8>()
219 {
220 std::stringstream resp;
221 resp << "{'label':'short string test', 'singlechar':'a', 'empty':'', 'endoftest':'end' }";
222 LLSD response;
223 S32 count = LLSDSerialize::fromNotation(response, resp);
224 ensure_equals("parse count", count, 5);
225 ensure_equals("sd type", response.type(), LLSD::TypeMap);
226 ensure_equals("map element count", response.size(), 4);
227 ensure_equals("singlechar", response["singlechar"].asString(), "a");
228 ensure_equals("empty", response["empty"].asString(), "");
229 }
230
231 template<> template<>
232 void sd_object::test<9>()
233 {
234 std::ostringstream resp;
235 resp << "{'label':'short binary test', 'singlebinary':b(1)\"A\", 'singlerawstring':s(1)\"A\", 'endoftest':'end' }";
236 std::string str = resp.str();
237 LLSD sd;
238 LLMemoryStream mstr((U8*)str.c_str(), str.size());
239 S32 count = LLSDSerialize::fromNotation(sd, mstr);
240 ensure_equals("parse count", count, 5);
241 ensure("sd created", sd.isDefined());
242 ensure_equals("sd type", sd.type(), LLSD::TypeMap);
243 ensure_equals("map element count", sd.size(), 4);
244 ensure_equals(
245 "label",
246 sd["label"].asString(),
247 "short binary test");
248 std::vector<U8> bin = sd["singlebinary"].asBinary();
249 std::vector<U8> expected;
250 expected.resize(1);
251 expected[0] = 'A';
252 ensure("single binary", (0 == memcmp(&bin[0], &expected[0], 1)));
253 ensure_equals(
254 "single string",
255 sd["singlerawstring"].asString(),
256 std::string("A"));
257 ensure_equals("end", sd["endoftest"].asString(), "end");
258 }
259
260 template<> template<>
261 void sd_object::test<10>()
262 {
263
264 std::string message("parcel '' is naughty.");
265 std::stringstream str;
266 str << "{'message':'" << LLSDNotationFormatter::escapeString(message)
267 << "'}";
268 std::string expected_str("{'message':'parcel \\'\\' is naughty.'}");
269 std::string actual_str = str.str();
270 ensure_equals("stream contents", actual_str, expected_str);
271 LLSD sd;
272 S32 count = LLSDSerialize::fromNotation(sd, str);
273 ensure_equals("parse count", count, 2);
274 ensure("valid parse", sd.isDefined());
275 std::string actual = sd["message"].asString();
276 ensure_equals("message contents", actual, message);
277 }
278
279 template<> template<>
280 void sd_object::test<11>()
281 {
282 std::string expected("\"\"\"\"''''''\"");
283 std::stringstream str;
284 str << "'" << LLSDNotationFormatter::escapeString(expected) << "'";
285 LLSD sd;
286 S32 count = LLSDSerialize::fromNotation(sd, str);
287 ensure_equals("parse count", count, 1);
288 ensure_equals("string value", sd.asString(), expected);
289 }
290
291 template<> template<>
292 void sd_object::test<12>()
293 {
294 std::string expected("mytest\\");
295 std::stringstream str;
296 str << "'" << LLSDNotationFormatter::escapeString(expected) << "'";
297 LLSD sd;
298 S32 count = LLSDSerialize::fromNotation(sd, str);
299 ensure_equals("parse count", count, 1);
300 ensure_equals("string value", sd.asString(), expected);
301 }
302
303 template<> template<>
304 void sd_object::test<13>()
305 {
306 for(S32 i = 0; i < 10000; ++i)
307 {
308 // gen up a starting point
309 std::string expected;
310 srand(1337 + i);
311 S32 size = rand() % 30 + 5;
312 std::generate_n(
313 std::back_insert_iterator<std::string>(expected),
314 size,
315 rand);
316 std::stringstream str;
317 str << "'" << LLSDNotationFormatter::escapeString(expected) << "'";
318 LLSD sd;
319 S32 count = LLSDSerialize::fromNotation(sd, str);
320 ensure_equals("parse count", count, 1);
321 std::string actual = sd.asString();
322/*
323 if(actual != expected)
324 {
325 llwarns << "iteration " << i << llendl;
326 std::ostringstream e_str;
327 std::string::iterator iter = expected.begin();
328 std::string::iterator end = expected.end();
329 for(; iter != end; ++iter)
330 {
331 e_str << (S32)((U8)(*iter)) << " ";
332 }
333 e_str << std::endl;
334 llsd_serialize_string(e_str, expected);
335 llwarns << "expected size: " << expected.size() << llendl;
336 llwarns << "expected: " << e_str.str() << llendl;
337
338 std::ostringstream a_str;
339 iter = actual.begin();
340 end = actual.end();
341 for(; iter != end; ++iter)
342 {
343 a_str << (S32)((U8)(*iter)) << " ";
344 }
345 a_str << std::endl;
346 llsd_serialize_string(a_str, actual);
347 llwarns << "actual size: " << actual.size() << llendl;
348 llwarns << "actual: " << a_str.str() << llendl;
349 }
350*/
351 ensure_equals("string value", actual, expected);
352 }
353 }
354
355 template<> template<>
356 void sd_object::test<14>()
357 {
358 std::string param = "[{'version':i1},{'data':{'binary_bucket':b(0)\"\"},'from_id':u3c115e51-04f4-523c-9fa6-98aff1034730,'from_name':'Phoenix Linden','id':u004e45e5-5576-277a-fba7-859d6a4cb5c8,'message':'hey','offline':i0,'timestamp':i0,'to_id':u3c5f1bb4-5182-7546-6401-1d329b4ff2f8,'type':i0},{'agent_id':u3c115e51-04f4-523c-9fa6-98aff1034730,'god_level':i0,'limited_to_estate':i1}]";
359 std::istringstream istr;
360 istr.str(param);
361 LLSD param_sd;
362 LLSDSerialize::fromNotation(param_sd, istr);
363 ensure_equals("parsed type", param_sd.type(), LLSD::TypeArray);
364 LLSD version_sd = param_sd[0];
365 ensure_equals("version type", version_sd.type(), LLSD::TypeMap);
366 ensure("has version", version_sd.has("version"));
367 ensure_equals("version number", version_sd["version"].asInteger(), 1);
368 LLSD src_sd = param_sd[1];
369 ensure_equals("src type", src_sd.type(), LLSD::TypeMap);
370 LLSD dst_sd = param_sd[2];
371 ensure_equals("dst type", dst_sd.type(), LLSD::TypeMap);
372 }
373
374 template<> template<>
375 void sd_object::test<15>()
376 {
377 std::string val = "[{'failures':!,'successfuls':[u3c115e51-04f4-523c-9fa6-98aff1034730]}]";
378 std::istringstream istr;
379 istr.str(val);
380 LLSD sd;
381 LLSDSerialize::fromNotation(sd, istr);
382 ensure_equals("parsed type", sd.type(), LLSD::TypeArray);
383 ensure_equals("parsed size", sd.size(), 1);
384 LLSD failures = sd[0]["failures"];
385 ensure("no failures.", failures.isUndefined());
386 LLSD success = sd[0]["successfuls"];
387 ensure_equals("success type", success.type(), LLSD::TypeArray);
388 ensure_equals("success size", success.size(), 1);
389 ensure_equals("success instance type", success[0].type(), LLSD::TypeUUID);
390 }
391
392 template<> template<>
393 void sd_object::test<16>()
394 {
395 std::string val = "[f,t,0,1,{'foo':t,'bar':f}]";
396 std::istringstream istr;
397 istr.str(val);
398 LLSD sd;
399 LLSDSerialize::fromNotation(sd, istr);
400 ensure_equals("parsed type", sd.type(), LLSD::TypeArray);
401 ensure_equals("parsed size", sd.size(), 5);
402 ensure_equals("element 0 false", sd[0].asBoolean(), false);
403 ensure_equals("element 1 true", sd[1].asBoolean(), true);
404 ensure_equals("element 2 false", sd[2].asBoolean(), false);
405 ensure_equals("element 3 true", sd[3].asBoolean(), true);
406 LLSD map = sd[4];
407 ensure_equals("element 4 type", map.type(), LLSD::TypeMap);
408 ensure_equals("map foo type", map["foo"].type(), LLSD::TypeBoolean);
409 ensure_equals("map foo value", map["foo"].asBoolean(), true);
410 ensure_equals("map bar type", map["bar"].type(), LLSD::TypeBoolean);
411 ensure_equals("map bar value", map["bar"].asBoolean(), false);
412 }
413
414/*
415 template<> template<>
416 void sd_object::test<16>()
417 {
418 }
419*/
420}
421
422#if 0
423'{\'task_id\':u1fd77b79-a8e7-25a5-9454-02a4d948ba1c}\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\t00082000\n\t\tcreator_id\t3c115e51-04f4-523c-9fa6-98aff1034730\n\t\towner_id\t3c115e51-04f4-523c-9fa6-98aff1034730\n\t\tlast_owner_id\t00000000-0000-0000-0000-000000000000\n\t\tgroup_id\t00000000-0000-0000-0000-000000000000\n\t}\n\tlocal_id\t10284\n\ttotal_crc\t35\n\ttype\t1\n\ttask_valid\t2\n\ttravel_access\t21\n\tdisplayopts\t2\n\tdisplaytype\tv\n\tpos\t0\t0\t0\n\toldpos\t0\t0\t0\n\trotation\t4.371139183945160766597837e-08\t1\t4.371139183945160766597837e-08\t0\n\tvelocity\t0\t0\t0\n\tangvel\t0\t0\t0\n\tscale\t0.2816932\t0.2816932\t0.2816932\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\t80\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\t89556747-24cb-43ed-920b-47caed15465f\n\t\tcolors\t1 1 1 1\n\t\tscales\t0.56\n\t\tscalet\t0.56\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\t89556747-24cb-43ed-920b-47caed15465f\n\t\tcolors\t1 1 1 1\n\t\tscales\t0.56\n\t\tscalet\t0.56\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\t89556747-24cb-43ed-920b-47caed15465f\n\t\tcolors\t1 1 1 1\n\t\tscales\t0.56\n\t\tscalet\t0.56\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\t89556747-24cb-43ed-920b-47caed15465f\n\t\tcolors\t1 1 1 1\n\t\tscales\t0.56\n\t\tscalet\t0.56\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\t89556747-24cb-43ed-920b-47caed15465f\n\t\tcolors\t1 1 1 1\n\t\tscales\t0.56\n\t\tscalet\t0.56\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\t89556747-24cb-43ed-920b-47caed15465f\n\t\tcolors\t1 1 1 1\n\t\tscales\t0.56\n\t\tscalet\t0.56\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\t1132625972249870\n\tbirthtime\t1132625953120694\n\treztime\t1132625953120694\n\tparceltime\t1132625953120694\n\ttax_rate\t1.01615\n\tnamevalue\tAttachmentOrientation VEC3 RW DS -3.141593, 0.000000, -3.141593\n\tnamevalue\tAttachmentOffset VEC3 RW DS 0.000000, 0.000000, 0.000000\n\tnamevalue\tAttachPt U32 RW S 5\n\tnamevalue\tAttachItemID STRING RW SV 1f9975c0-2951-1b93-dd83-46e2b932fcc8\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\t52019cdd-b464-ba19-e66d-3da751fef9da\n\torig_item_id\t1f9975c0-2951-1b93-dd83-46e2b932fcc8\n\tcorrect_family_id\t00000000-0000-0000-0000-000000000000\n\thas_rezzed\t0\n\tpre_link_base_mask\t7fffffff\n\tdefault_pay_price\t-2\t1\t5\t10\t20\n}\n'
424#endif
425
426namespace tut
427{
428 struct mem_data
429 {
430 };
431 typedef test_group<mem_data> mem_test;
432 typedef mem_test::object mem_object;
433 tut::mem_test mem_stream("memory_stream");
434
435 template<> template<>
436 void mem_object::test<1>()
437 {
438 const char HELLO_WORLD[] = "hello world";
439 LLMemoryStream mem((U8*)&HELLO_WORLD[0], strlen(HELLO_WORLD));
440 std::string hello;
441 std::string world;
442 mem >> hello >> world;
443 ensure_equals("first word", hello, std::string("hello"));
444 ensure_equals("second word", world, std::string("world"));
445 }
446}
447
diff --git a/linden/indra/test/files.lst b/linden/indra/test/files.lst
new file mode 100644
index 0000000..3824bd8
--- /dev/null
+++ b/linden/indra/test/files.lst
@@ -0,0 +1,18 @@
1test/common.cpp
2test/inventory.cpp
3test/io.cpp
4test/llapp_tut.cpp
5test/llhttpclient_tut.cpp
6test/llhttpnode_tut.cpp
7test/lliohttpserver_tut.cpp
8test/llmime_tut.cpp
9test/llpipeutil.cpp
10test/llsd_new_tut.cpp
11test/llsdserialize_tut.cpp
12test/llsd_message_system_tut.cpp
13test/lltiming_tut.cpp
14test/lltut.cpp
15test/lluri_tut.cpp
16test/math.cpp
17test/reflection_tut.cpp
18test/test.cpp
diff --git a/linden/indra/test/inventory.cpp b/linden/indra/test/inventory.cpp
new file mode 100644
index 0000000..2099da3
--- /dev/null
+++ b/linden/indra/test/inventory.cpp
@@ -0,0 +1,167 @@
1/**
2 * @file inventory.cpp
3 * @author Phoenix
4 * @date 2005-11-15
5 * @brief Functions for inventory test framework
6 *
7 * Copyright (c) 2005-2007, Linden Research, Inc.
8 *
9 * The source code in this file ("Source Code") is provided by Linden Lab
10 * to you under the terms of the GNU General Public License, version 2.0
11 * ("GPL"), unless you have obtained a separate licensing agreement
12 * ("Other License"), formally executed by you and Linden Lab. Terms of
13 * the GPL can be found in doc/GPL-license.txt in this distribution, or
14 * online at http://secondlife.com/developers/opensource/gplv2
15 *
16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlife.com/developers/opensource/flossexception
20 *
21 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above,
23 * and agree to abide by those obligations.
24 *
25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27 * COMPLETENESS OR PERFORMANCE.
28 */
29
30/**
31 *
32 * THOROUGH_DESCRIPTION of inventory.cpp
33 *
34 */
35
36#include "linden_common.h"
37#include "lltut.h"
38#include "llinventory.h"
39#include "llsd.h"
40
41LLPointer<LLInventoryItem> create_random_inventory_item()
42{
43 LLUUID item_id;
44 item_id.generate();
45 LLUUID parent_id;
46 parent_id.generate();
47 LLPermissions perm;
48 LLUUID creator_id;
49 creator_id.generate();
50 LLUUID owner_id;
51 owner_id.generate();
52 LLUUID last_owner_id;
53 last_owner_id.generate();
54 LLUUID group_id;
55 group_id.generate();
56 perm.init(creator_id, owner_id, last_owner_id, group_id);
57 perm.initMasks(PERM_ALL, PERM_ALL, PERM_COPY, PERM_COPY, PERM_MODIFY | PERM_COPY);
58 LLUUID asset_id;
59 asset_id.generate();
60 S32 price = rand();
61 LLSaleInfo sale_info(LLSaleInfo::FS_COPY, price);
62 U32 flags = rand();
63 S32 creation = time(NULL);
64
65 LLPointer<LLInventoryItem> item = new LLInventoryItem(
66 item_id,
67 parent_id,
68 perm,
69 asset_id,
70 LLAssetType::AT_OBJECT,
71 LLInventoryType::IT_ATTACHMENT,
72 "Sample Object",
73 "Used for Testing",
74 sale_info,
75 flags,
76 creation);
77 return item;
78}
79
80LLPointer<LLInventoryCategory> create_random_inventory_cat()
81{
82 LLUUID item_id;
83 item_id.generate();
84 LLUUID parent_id;
85 parent_id.generate();
86
87 LLPointer<LLInventoryCategory> cat = new LLInventoryCategory(
88 item_id,
89 parent_id,
90 LLAssetType::AT_NONE,
91 "Sample category");
92 return cat;
93}
94
95namespace tut
96{
97 struct inventory_data
98 {
99 };
100 typedef test_group<inventory_data> inventory_test;
101 typedef inventory_test::object inventory_object;
102 tut::inventory_test inv("llinventory");
103
104 template<> template<>
105 void inventory_object::test<1>()
106 {
107 LLPointer<LLInventoryItem> src = create_random_inventory_item();
108 LLSD sd = ll_create_sd_from_inventory_item(src);
109 //llinfos << "sd: " << *sd << llendl;
110 LLPointer<LLInventoryItem> dst;
111 dst = ll_create_item_from_sd(sd);
112 ensure_equals("item id", dst->getUUID(), src->getUUID());
113 ensure_equals("parent", dst->getParentUUID(), src->getParentUUID());
114 ensure_equals("name", dst->getName(), src->getName());
115 ensure_equals("type", dst->getType(), src->getType());
116 ensure_equals(
117 "permissions",
118 dst->getPermissions(),
119 src->getPermissions());
120 ensure_equals(
121 "description",
122 dst->getDescription(),
123 src->getDescription());
124 ensure_equals(
125 "sale type",
126 dst->getSaleInfo().getSaleType(),
127 src->getSaleInfo().getSaleType());
128 ensure_equals(
129 "sale price",
130 dst->getSaleInfo().getSalePrice(),
131 src->getSaleInfo().getSalePrice());
132 ensure_equals("asset id", dst->getAssetUUID(), src->getAssetUUID());
133 ensure_equals(
134 "inventory type",
135 dst->getInventoryType(),
136 src->getInventoryType());
137 ensure_equals("flags", dst->getFlags(), src->getFlags());
138 ensure_equals(
139 "creation",
140 dst->getCreationDate(),
141 src->getCreationDate());
142 }
143
144 template<> template<>
145 void inventory_object::test<2>()
146 {
147 LLPointer<LLInventoryCategory> src = create_random_inventory_cat();
148 LLSD sd = ll_create_sd_from_inventory_category(src);
149 LLPointer<LLInventoryCategory> dst = ll_create_category_from_sd(sd);
150 ensure_equals("item id", dst->getUUID(), src->getUUID());
151 ensure_equals("parent", dst->getParentUUID(), src->getParentUUID());
152 ensure_equals("name", dst->getName(), src->getName());
153 ensure_equals("type", dst->getType(), src->getType());
154 ensure_equals(
155 "preferred type",
156 dst->getPreferredType(),
157 src->getPreferredType());
158 }
159
160/*
161 template<> template<>
162 void inventory_object::test<3>()
163 {
164
165 }
166*/
167}
diff --git a/linden/indra/test/io.cpp b/linden/indra/test/io.cpp
new file mode 100644
index 0000000..2f6ba09
--- /dev/null
+++ b/linden/indra/test/io.cpp
@@ -0,0 +1,1387 @@
1/**
2 * @file io.cpp
3 * @author Phoenix
4 * @date 2005-10-02
5 * @brief Tests for io classes and helpers
6 *
7 * Copyright (c) 2005-2007, Linden Research, Inc.
8 *
9 * The source code in this file ("Source Code") is provided by Linden Lab
10 * to you under the terms of the GNU General Public License, version 2.0
11 * ("GPL"), unless you have obtained a separate licensing agreement
12 * ("Other License"), formally executed by you and Linden Lab. Terms of
13 * the GPL can be found in doc/GPL-license.txt in this distribution, or
14 * online at http://secondlife.com/developers/opensource/gplv2
15 *
16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlife.com/developers/opensource/flossexception
20 *
21 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above,
23 * and agree to abide by those obligations.
24 *
25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27 * COMPLETENESS OR PERFORMANCE.
28 */
29
30#include "linden_common.h"
31#include "lltut.h"
32
33#include <iterator>
34
35#include <apr-1/apr_pools.h>
36
37#include "llbuffer.h"
38#include "llbufferstream.h"
39#include "lliosocket.h"
40#include "llioutil.h"
41#include "llmemorystream.h"
42#include "llpipeutil.h"
43#include "llpumpio.h"
44#include "llsd.h"
45#include "llsdrpcclient.h"
46#include "llsdrpcserver.h"
47#include "llsdserialize.h"
48#include "lluuid.h"
49#include "llinstantmessage.h"
50
51namespace tut
52{
53 struct buffer_data
54 {
55 LLBufferArray mBuffer;
56 };
57 typedef test_group<buffer_data> buffer_test;
58 typedef buffer_test::object buffer_object;
59 tut::buffer_test tba("buffer_array");
60
61 template<> template<>
62 void buffer_object::test<1>()
63 {
64 const char HELLO_WORLD[] = "hello world";
65 const S32 str_len = strlen(HELLO_WORLD);
66 LLChannelDescriptors ch = mBuffer.nextChannel();
67 mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len);
68 S32 count = mBuffer.countAfter(ch.in(), NULL);
69 ensure_equals("total append size", count, str_len);
70 LLBufferArray::segment_iterator_t it = mBuffer.beginSegment();
71 U8* first = (*it).data();
72 count = mBuffer.countAfter(ch.in(), first);
73 ensure_equals("offset append size", count, str_len - 1);
74 }
75
76 template<> template<>
77 void buffer_object::test<2>()
78 {
79 const char HELLO_WORLD[] = "hello world";
80 const S32 str_len = strlen(HELLO_WORLD);
81 LLChannelDescriptors ch = mBuffer.nextChannel();
82 mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len);
83 mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len);
84 S32 count = mBuffer.countAfter(ch.in(), NULL);
85 ensure_equals("total append size", count, 2 * str_len);
86 LLBufferArray::segment_iterator_t it = mBuffer.beginSegment();
87 U8* first = (*it).data();
88 count = mBuffer.countAfter(ch.in(), first);
89 ensure_equals("offset append size", count, (2 * str_len) - 1);
90 }
91
92 template<> template<>
93 void buffer_object::test<3>()
94 {
95 const char ONE[] = "one";
96 const char TWO[] = "two";
97 std::string expected(ONE);
98 expected.append(TWO);
99 LLChannelDescriptors ch = mBuffer.nextChannel();
100 mBuffer.append(ch.in(), (U8*)ONE, 3);
101 mBuffer.append(ch.in(), (U8*)TWO, 3);
102 char buffer[255];
103 S32 len = 6;
104 mBuffer.readAfter(ch.in(), NULL, (U8*)buffer, len);
105 ensure_equals(len, 6);
106 buffer[len] = '\0';
107 std::string actual(buffer);
108 ensure_equals("read", actual, expected);
109 }
110
111 template<> template<>
112 void buffer_object::test<4>()
113 {
114 const char ONE[] = "one";
115 const char TWO[] = "two";
116 std::string expected(ONE);
117 expected.append(TWO);
118 LLChannelDescriptors ch = mBuffer.nextChannel();
119 mBuffer.append(ch.in(), (U8*)TWO, 3);
120 mBuffer.prepend(ch.in(), (U8*)ONE, 3);
121 char buffer[255];
122 S32 len = 6;
123 mBuffer.readAfter(ch.in(), NULL, (U8*)buffer, len);
124 ensure_equals(len, 6);
125 buffer[len] = '\0';
126 std::string actual(buffer);
127 ensure_equals("read", actual, expected);
128 }
129
130 template<> template<>
131 void buffer_object::test<5>()
132 {
133 const char ONE[] = "one";
134 const char TWO[] = "two";
135 std::string expected("netwo");
136 LLChannelDescriptors ch = mBuffer.nextChannel();
137 mBuffer.append(ch.in(), (U8*)TWO, 3);
138 mBuffer.prepend(ch.in(), (U8*)ONE, 3);
139 char buffer[255];
140 S32 len = 5;
141 LLBufferArray::segment_iterator_t it = mBuffer.beginSegment();
142 U8* addr = (*it).data();
143 mBuffer.readAfter(ch.in(), addr, (U8*)buffer, len);
144 ensure_equals(len, 5);
145 buffer[len] = '\0';
146 std::string actual(buffer);
147 ensure_equals("read", actual, expected);
148 }
149
150 template<> template<>
151 void buffer_object::test<6>()
152 {
153 std::string request("The early bird catches the worm.");
154 std::string response("If you're a worm, sleep late.");
155 std::ostringstream expected;
156 expected << "ContentLength: " << response.length() << "\r\n\r\n"
157 << response;
158 LLChannelDescriptors ch = mBuffer.nextChannel();
159 mBuffer.append(ch.in(), (U8*)request.c_str(), request.length());
160 mBuffer.append(ch.out(), (U8*)response.c_str(), response.length());
161 S32 count = mBuffer.countAfter(ch.out(), NULL);
162 std::ostringstream header;
163 header << "ContentLength: " << count << "\r\n\r\n";
164 std::string head(header.str());
165 mBuffer.prepend(ch.out(), (U8*)head.c_str(), head.length());
166 char buffer[1024];
167 S32 len = response.size() + head.length();
168 ensure_equals("same length", len, (S32)expected.str().length());
169 mBuffer.readAfter(ch.out(), NULL, (U8*)buffer, len);
170 buffer[len] = '\0';
171 std::string actual(buffer);
172 ensure_equals("threaded writes", actual, expected.str());
173 }
174
175 template<> template<>
176 void buffer_object::test<7>()
177 {
178 const S32 LINE_COUNT = 3;
179 std::string lines[LINE_COUNT] =
180 {
181 std::string("GET /index.htm HTTP/1.0\r\n"),
182 std::string("User-Agent: Wget/1.9.1\r\n"),
183 std::string("Host: localhost:8008\r\n")
184 };
185 std::string text;
186 S32 i;
187 for(i = 0; i < LINE_COUNT; ++i)
188 {
189 text.append(lines[i]);
190 }
191 LLChannelDescriptors ch = mBuffer.nextChannel();
192 mBuffer.append(ch.in(), (U8*)text.c_str(), text.length());
193 const S32 BUFFER_LEN = 1024;
194 char buf[BUFFER_LEN];
195 S32 len;
196 U8* last = NULL;
197 std::string last_line;
198 for(i = 0; i < LINE_COUNT; ++i)
199 {
200 len = BUFFER_LEN;
201 last = mBuffer.readAfter(ch.in(), last, (U8*)buf, len);
202 char* newline = strchr((char*)buf, '\n');
203 S32 offset = -((len - 1) - (newline - buf));
204 ++newline;
205 *newline = '\0';
206 last_line.assign(buf);
207 std::ostringstream message;
208 message << "line reads in line[" << i << "]";
209 ensure_equals(message.str().c_str(), last_line, lines[i]);
210 last = mBuffer.seek(ch.in(), last, offset);
211 }
212 }
213
214 template<> template<>
215 void buffer_object::test<8>()
216 {
217 LLChannelDescriptors ch = mBuffer.nextChannel();
218 mBuffer.append(ch.in(), (U8*)"1", 1);
219 LLBufferArray buffer;
220 buffer.append(ch.in(), (U8*)"2", 1);
221 mBuffer.takeContents(buffer);
222 mBuffer.append(ch.in(), (U8*)"3", 1);
223 S32 count = mBuffer.countAfter(ch.in(), NULL);
224 ensure_equals("buffer size", count, 3);
225 U8* temp = new U8[count];
226 mBuffer.readAfter(ch.in(), NULL, temp, count);
227 ensure("buffer content", (0 == memcmp(temp, (void*)"123", 3)));
228 delete[] temp;
229 }
230
231/*
232 template<> template<>
233 void buffer_object::test<9>()
234 {
235 char buffer[1024];
236 S32 size = sprintf(buffer,
237 "%d|%d|%s|%s|%s|%s|%s|%x|%x|%x|%x|%x|%s|%s|%d|%d|%x",
238 7,
239 7,
240 "Hang Glider INFO",
241 "18e84d1e-04a4-4c0d-8cb6-6c73477f0a9a",
242 "0e346d8b-4433-4d66-a6b0-fd37083abc4c",
243 "0e346d8b-4433-4d66-a6b0-fd37083abc4c",
244 "00000000-0000-0000-0000-000000000000",
245 0x7fffffff,
246 0x7fffffff,
247 0,
248 0,
249 0x7fffffff,
250 "69e0d357-2e7c-8990-a2bc-7f61c868e5a3",
251 "2004-06-04 16:09:17 note card",
252 0,
253 10,
254 0) + 1;
255
256 //const char* expected = "7|7|Hang Glider INFO|18e84d1e-04a4-4c0d-8cb6-6c73477f0a9a|0e346d8b-4433-4d66-a6b0-fd37083abc4c|0e346d8b-4433-4d66-a6b0-fd37083abc4c|00000000-0000-0000-0000-000000000000|7fffffff|7fffffff|0|0|7fffffff|69e0d357-2e7c-8990-a2bc-7f61c868e5a3|2004-06-04 16:09:17 note card|0|10|0\0";
257
258 LLSD* bin_bucket = LLIMInfo::buildSDfrombuffer((U8*)buffer,size);
259
260 char post_buffer[1024];
261 U32 post_size;
262 LLIMInfo::getBinaryBucket(bin_bucket,(U8*)post_buffer,post_size);
263 ensure_equals("Buffer sizes",size,(S32)post_size);
264 ensure("Buffer content",!strcmp(buffer,post_buffer));
265 }
266*/
267
268 /*
269 template<> template<>
270 void buffer_object::test<>()
271 {
272 }
273 */
274}
275
276namespace tut
277{
278 struct buffer_and_stream_data
279 {
280 LLBufferArray mBuffer;
281 };
282 typedef test_group<buffer_and_stream_data> bas_test;
283 typedef bas_test::object bas_object;
284 tut::bas_test tbs("buffer_stream");
285
286 template<> template<>
287 void bas_object::test<1>()
288 {
289 const char HELLO_WORLD[] = "hello world";
290 const S32 str_len = strlen(HELLO_WORLD);
291 LLChannelDescriptors ch = mBuffer.nextChannel();
292 LLBufferStream str(ch, &mBuffer);
293 mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len);
294 std::string hello;
295 std::string world;
296 str >> hello >> world;
297 ensure_equals("first word", hello, std::string("hello"));
298 ensure_equals("second word", world, std::string("world"));
299 }
300
301 template<> template<>
302 void bas_object::test<2>()
303 {
304 std::string part1("Eat my shor");
305 std::string part2("ts ho");
306 std::string part3("mer");
307 std::string ignore("ignore me");
308 LLChannelDescriptors ch = mBuffer.nextChannel();
309 LLBufferStream str(ch, &mBuffer);
310 mBuffer.append(ch.in(), (U8*)part1.c_str(), part1.length());
311 mBuffer.append(ch.in(), (U8*)part2.c_str(), part2.length());
312 mBuffer.append(ch.out(), (U8*)ignore.c_str(), ignore.length());
313 mBuffer.append(ch.in(), (U8*)part3.c_str(), part3.length());
314 std::string eat;
315 std::string my;
316 std::string shorts;
317 std::string homer;
318 str >> eat >> my >> shorts >> homer;
319 ensure_equals("word1", eat, std::string("Eat"));
320 ensure_equals("word2", my, std::string("my"));
321 ensure_equals("word3", shorts, std::string("shorts"));
322 ensure_equals("word4", homer, std::string("homer"));
323 }
324
325 template<> template<>
326 void bas_object::test<3>()
327 {
328 std::string part1("junk in ");
329 std::string part2("the trunk");
330 const S32 CHANNEL = 0;
331 mBuffer.append(CHANNEL, (U8*)part1.c_str(), part1.length());
332 mBuffer.append(CHANNEL, (U8*)part2.c_str(), part2.length());
333 U8* last = 0;
334 const S32 BUF_LEN = 128;
335 char buf[BUF_LEN];
336 S32 len = 11;
337 last = mBuffer.readAfter(CHANNEL, last, (U8*)buf, len);
338 buf[len] = '\0';
339 std::string actual(buf);
340 ensure_equals("first read", actual, std::string("junk in the"));
341 last = mBuffer.seek(CHANNEL, last, -6);
342 len = 12;
343 last = mBuffer.readAfter(CHANNEL, last, (U8*)buf, len);
344 buf[len] = '\0';
345 actual.assign(buf);
346 ensure_equals("seek and read", actual, std::string("in the trunk"));
347 }
348
349 template<> template<>
350 void bas_object::test<4>()
351 {
352 std::string phrase("zippity do da!");
353 const S32 CHANNEL = 0;
354 mBuffer.append(CHANNEL, (U8*)phrase.c_str(), phrase.length());
355 const S32 BUF_LEN = 128;
356 char buf[BUF_LEN];
357 S32 len = 7;
358 U8* last = mBuffer.readAfter(CHANNEL, NULL, (U8*)buf, len);
359 mBuffer.splitAfter(last);
360 LLBufferArray::segment_iterator_t it = mBuffer.beginSegment();
361 LLBufferArray::segment_iterator_t end = mBuffer.endSegment();
362 std::string first((char*)((*it).data()), (*it).size());
363 ensure_equals("first part", first, std::string("zippity"));
364 ++it;
365 std::string second((char*)((*it).data()), (*it).size());
366 ensure_equals("second part", second, std::string(" do da!"));
367 ++it;
368 ensure("iterators equal", (it == end));
369 }
370
371 template<> template<>
372 void bas_object::test<5>()
373 {
374 LLChannelDescriptors ch = mBuffer.nextChannel();
375 LLBufferStream str(ch, &mBuffer);
376 std::string h1("hello");
377 std::string h2(", how are you doing?");
378 std::string expected(h1);
379 expected.append(h2);
380 str << h1 << h2;
381 str.flush();
382 const S32 BUF_LEN = 128;
383 char buf[BUF_LEN];
384 S32 actual_len = BUF_LEN;
385 S32 expected_len = h1.size() + h2.size();
386 (void) mBuffer.readAfter(ch.out(), NULL, (U8*)buf, actual_len);
387 ensure_equals("streamed size", actual_len, expected_len);
388 buf[actual_len] = '\0';
389 std::string actual(buf);
390 ensure_equals("streamed to buf", actual, expected);
391 }
392
393 template<> template<>
394 void bas_object::test<6>()
395 {
396 LLChannelDescriptors ch = mBuffer.nextChannel();
397 LLBufferStream bstr(ch, &mBuffer);
398 std::ostringstream ostr;
399 std::vector<LLUUID> ids;
400 LLUUID id;
401 for(int i = 0; i < 5; ++i)
402 {
403 id.generate();
404 ids.push_back(id);
405 }
406 bstr << "SELECT concat(u.username, ' ', l.name) "
407 << "FROM user u, user_last_name l "
408 << "WHERE u.last_name_id = l.last_name_id"
409 << " AND u.agent_id IN ('";
410 ostr << "SELECT concat(u.username, ' ', l.name) "
411 << "FROM user u, user_last_name l "
412 << "WHERE u.last_name_id = l.last_name_id"
413 << " AND u.agent_id IN ('";
414 std::copy(
415 ids.begin(),
416 ids.end(),
417 std::ostream_iterator<LLUUID>(bstr, "','"));
418 std::copy(
419 ids.begin(),
420 ids.end(),
421 std::ostream_iterator<LLUUID>(ostr, "','"));
422 bstr.seekp(-2, std::ios::cur);
423 ostr.seekp(-2, std::ios::cur);
424 bstr << ") ";
425 ostr << ") ";
426 bstr.flush();
427 const S32 BUF_LEN = 512;
428 char buf[BUF_LEN];
429 S32 actual_len = BUF_LEN;
430 (void) mBuffer.readAfter(ch.out(), NULL, (U8*)buf, actual_len);
431 buf[actual_len] = '\0';
432 std::string actual(buf);
433 std::string expected(ostr.str());
434 ensure_equals("size of string in seek",actual.size(),expected.size());
435 ensure_equals("seek in ostream", actual, expected);
436 }
437
438 template<> template<>
439 void bas_object::test<7>()
440 {
441 LLChannelDescriptors ch = mBuffer.nextChannel();
442 LLBufferStream bstr(ch, &mBuffer);
443 bstr << "1";
444 bstr.flush();
445 S32 count = mBuffer.countAfter(ch.out(), NULL);
446 ensure_equals("buffer size 1", count, 1);
447 LLBufferArray buffer;
448 buffer.append(ch.out(), (U8*)"2", 1);
449 mBuffer.takeContents(buffer);
450 count = mBuffer.countAfter(ch.out(), NULL);
451 ensure_equals("buffer size 2", count, 2);
452 bstr << "3";
453 bstr.flush();
454 count = mBuffer.countAfter(ch.out(), NULL);
455 ensure_equals("buffer size 3", count, 3);
456 U8* temp = new U8[count];
457 mBuffer.readAfter(ch.out(), NULL, temp, count);
458 ensure("buffer content", (0 == memcmp(temp, (void*)"123", 3)));
459 delete[] temp;
460 }
461
462 template<> template<>
463 void bas_object::test<8>()
464 {
465 LLChannelDescriptors ch = mBuffer.nextChannel();
466 LLBufferStream ostr(ch, &mBuffer);
467 typedef std::vector<U8> buf_t;
468 typedef std::vector<buf_t> actual_t;
469 actual_t actual;
470 buf_t source;
471 bool need_comma = false;
472 ostr << "[";
473 S32 total_size = 1;
474 for(S32 i = 2000; i < 2003; ++i)
475 {
476 if(need_comma)
477 {
478 ostr << ",";
479 ++total_size;
480 }
481 need_comma = true;
482 srand(69 + i);
483 S32 size = rand() % 1000 + 1000;
484 std::generate_n(
485 std::back_insert_iterator<buf_t>(source),
486 size,
487 rand);
488 actual.push_back(source);
489 ostr << "b(" << size << ")\"";
490 total_size += 8;
491 ostr.write((const char*)(&source[0]), size);
492 total_size += size;
493 source.clear();
494 ostr << "\"";
495 ++total_size;
496 }
497 ostr << "]";
498 ++total_size;
499 ostr.flush();
500
501 // now that we have a bunch of data on a stream, parse it all.
502 ch = mBuffer.nextChannel();
503 S32 count = mBuffer.countAfter(ch.in(), NULL);
504 ensure_equals("size of buffer", count, total_size);
505 LLBufferStream istr(ch, &mBuffer);
506 LLSD data;
507 count = LLSDSerialize::fromNotation(data, istr);
508 ensure("sd parsed", data.isDefined());
509
510 for(S32 j = 0; j < 3; ++j)
511 {
512 std::ostringstream name;
513 LLSD child(data[j]);
514 name << "found buffer " << j;
515 ensure(name.str(), child.isDefined());
516 source = child.asBinary();
517 name.str("");
518 name << "buffer " << j << " size";
519 ensure_equals(name.str().c_str(), source.size(), actual[j].size());
520 name.str("");
521 name << "buffer " << j << " contents";
522 ensure(
523 name.str(),
524 (0 == memcmp(&source[0], &actual[j][0], source.size())));
525 }
526 }
527
528 template<> template<>
529 void bas_object::test<9>()
530 {
531 LLChannelDescriptors ch = mBuffer.nextChannel();
532 LLBufferStream ostr(ch, &mBuffer);
533 typedef std::vector<U8> buf_t;
534 buf_t source;
535 bool need_comma = false;
536 ostr << "{";
537 S32 total_size = 1;
538 for(S32 i = 1000; i < 3000; ++i)
539 {
540 if(need_comma)
541 {
542 ostr << ",";
543 ++total_size;
544 }
545 need_comma = true;
546 ostr << "'" << i << "':";
547 total_size += 7;
548 srand(69 + i);
549 S32 size = rand() % 1000 + 1000;
550 std::generate_n(
551 std::back_insert_iterator<buf_t>(source),
552 size,
553 rand);
554 ostr << "b(" << size << ")\"";
555 total_size += 8;
556 ostr.write((const char*)(&source[0]), size);
557 total_size += size;
558 source.clear();
559 ostr << "\"";
560 ++total_size;
561 }
562 ostr << "}";
563 ++total_size;
564 ostr.flush();
565
566 // now that we have a bunch of data on a stream, parse it all.
567 ch = mBuffer.nextChannel();
568 S32 count = mBuffer.countAfter(ch.in(), NULL);
569 ensure_equals("size of buffer", count, total_size);
570 LLBufferStream istr(ch, &mBuffer);
571 LLSD data;
572 count = LLSDSerialize::fromNotation(data, istr);
573 ensure("sd parsed", data.isDefined());
574 }
575
576 template<> template<>
577 void bas_object::test<10>()
578 {
579 const char LOGIN_STREAM[] = "{'method':'login', 'parameter': [ {"
580 "'uri': 'sl-am:kellys.region.siva.lindenlab.com/location?start=url&px=128&py=128&pz=128&lx=0&ly=0&lz=0'}, "
581 "{'version': i1}, {'texture_data': [ '61d724fb-ad79-f637-2186-5cf457560daa', '6e38b9be-b7cc-e77a-8aec-029a42b0b416', "
582 "'a9073524-e89b-2924-ca6e-a81944109a1a', '658f18b5-5f1e-e593-f5d5-36c3abc7249a', '0cc799f4-8c99-6b91-bd75-b179b12429e2', "
583 "'59fd9b64-8300-a425-aad8-2ffcbe9a49d2', '59fd9b64-8300-a425-aad8-2ffcbe9a49d2', '5748decc-f629-461c-9a36-a35a221fe21f', "
584 "'b8fc9be2-26a6-6b47-690b-0e902e983484', 'a13ca0fe-3802-dc97-e79a-70d12171c724', 'dd9643cf-fd5d-0376-ed4a-b1cc646a97d5', "
585 "'4ad13ae9-a112-af09-210a-cf9353a7a9e7', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', "
586 "'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', "
587 "'5748decc-f629-461c-9a36-a35a221fe21f', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97'],"
588 "'session_id': '324cfa9f-fe5d-4d1c-a317-35f20a86a4d1','position': [ i128, i128, i128],'last_name': 'Linden','group_title': '-> !BLING! <-','group_name': 'test!','agent_access': 'M',"
589 "'attachment_data': [ {'asset_id': 'aaede2b1-9955-09d4-5c93-2b557c778cf3','attachment_point': i6,'item_id': 'f3694abc-5122-db33-73d9-e0f4288dc2bf'}],"
590 "'buddy_ids': [ '101358d5-469d-4b24-9b85-4dc3c05e635d', '1b00fec7-6265-4875-acac-80d9cfe9295c', '203ad6df-b522-491d-ba48-4e24eb57aeff', "
591 "'22d4dcdb-aebb-47fa-b925-a871cc75ee48','27da3df5-1339-4463-80aa-40504ee3b3e5', '299d1720-b61f-4268-8c29-9614aa2d44c2', "
592 "'2b048a24-2737-4994-9fa5-becc8e466253', '2cd5dc14-a853-49a4-be3c-a5a7178e37bc', '3de548e1-57be-cfea-2b78-83ae3ad95998', "
593 "'3dee98e4-a6a3-4543-91c3-bbd528447ba7', '3e2d81a3-6263-6ffe-ad5c-8ce04bee07e9', '40e70b98-fed7-47f3-9700-1bce93f9350b', "
594 "'50a9b68e-b5aa-4d35-9137-3cfebda0a15c', '54295571-9357-43ff-ae74-a83b5138160f', '6191e2d7-5f96-4856-bdab-af0f79f47ae4', "
595 "'63e577d8-cd34-4235-a0a3-de0500133364', '79cfb666-4fd0-4af7-95df-fb7d96b4e24d', '8121c2f3-4a88-4c33-9899-8fc1273f47ee', "
596 "'909da964-ef23-4f2a-ba13-f2a8cfd454b6','a2e76fcd-9360-4f6d-a924-000000000001', 'aaa6d664-527e-4d83-9cbb-7ef79ccc7cc8', "
597 "'b79bfb6c-23be-49eb-b35b-30ff2f501b37', 'ba0d9c79-148c-4a79-8e3c-0665eebe2427', 'bc9bda98-57cd-498f-b993-4ff1ac9dec93', "
598 "'c62d16f6-81cb-419d-9cac-e46dc394084d', 'd48f8fa7-2512-4fe5-80c8-c0a923412e07', 'd77e3e24-7e6c-4c3f-96d0-a1746337f8fb', "
599 "'da615c63-a84b-4592-a3d6-a90dd3e92e6e', 'df47190a-7eb7-4aff-985f-2d1d3ad6c6e9', 'e3380196-72cd-499c-a2ba-caa180bd5fe4', "
600 "'e937863f-f134-4207-803b-d6e686651d6c', 'efcdf98b-5269-45ef-ac7a-0671f09ea9d9'],"
601 "'circuit_code': i124,'group_id': '8615c885-9cf0-bf0a-6e40-0c11462aa652','limited_to_estate': i1,'look_at': [ i0, i0, i0],"
602 "'agent_id': '0e346d8b-4433-4d66-a6b0-fd37083abc4c','first_name': 'Kelly','start': 'url'}]}";
603 LLChannelDescriptors ch = mBuffer.nextChannel();
604 mBuffer.append(ch.out(), (U8*)LOGIN_STREAM, strlen(LOGIN_STREAM));
605 ch = mBuffer.nextChannel();
606 LLBufferStream istr(ch, &mBuffer);
607 LLSD data;
608 S32 count = LLSDSerialize::fromNotation(data, istr);
609 ensure("parsed something", (count > 0));
610 ensure("sd parsed", data.isDefined());
611 ensure_equals("sd type", data.type(), LLSD::TypeMap);
612 ensure("has method", data.has("method"));
613 ensure("has parameter", data.has("parameter"));
614 LLSD parameter = data["parameter"];
615 ensure_equals("parameter is array", parameter.type(), LLSD::TypeArray);
616 LLSD agent_params = parameter[2];
617 std::string s_value;
618 s_value = agent_params["last_name"].asString();
619 ensure_equals("last name", s_value, std::string("Linden"));
620 s_value = agent_params["first_name"].asString();
621 ensure_equals("first name", s_value, std::string("Kelly"));
622 s_value = agent_params["agent_access"].asString();
623 ensure_equals("agent access", s_value, std::string("M"));
624 s_value = agent_params["group_name"].asString();
625 ensure_equals("group name", s_value, std::string("test!"));
626 s_value = agent_params["group_title"].asString();
627 ensure_equals("group title", s_value, std::string("-> !BLING! <-"));
628
629 LLUUID agent_id("0e346d8b-4433-4d66-a6b0-fd37083abc4c");
630 LLUUID id = agent_params["agent_id"];
631 ensure_equals("agent id", id, agent_id);
632 LLUUID session_id("324cfa9f-fe5d-4d1c-a317-35f20a86a4d1");
633 id = agent_params["session_id"];
634 ensure_equals("session id", id, session_id);
635 LLUUID group_id ("8615c885-9cf0-bf0a-6e40-0c11462aa652");
636 id = agent_params["group_id"];
637 ensure_equals("group id", id, group_id);
638
639 S32 i_val = agent_params["limited_to_estate"];
640 ensure_equals("limited to estate", i_val, 1);
641 i_val = agent_params["circuit_code"];
642 ensure_equals("circuit code", i_val, 124);
643 }
644
645
646 template<> template<>
647 void bas_object::test<11>()
648 {
649 std::string val = "{!'foo'@:#'bar'}";
650 std::istringstream istr;
651 istr.str(val);
652 LLSD sd;
653 S32 count = LLSDSerialize::fromNotation(sd, istr);
654 ensure_equals("parser error return value", count, -1);
655 ensure("data undefined", sd.isUndefined());
656 }
657
658 template<> template<>
659 void bas_object::test<12>()
660 {
661 std::string val = "{!'foo':[i1,'hi',{@'bar'#:[$i2%,^'baz'&]*}+]=}";
662 std::istringstream istr;
663 istr.str(val);
664 LLSD sd;
665 S32 count = LLSDSerialize::fromNotation(sd, istr);
666 ensure_equals("parser error return value", count, -1);
667 ensure("data undefined", sd.isUndefined());
668 }
669
670/*
671 template<> template<>
672 void bas_object::test<13>()
673 {
674 }
675 template<> template<>
676 void bas_object::test<14>()
677 {
678 }
679 template<> template<>
680 void bas_object::test<15>()
681 {
682 }
683*/
684}
685
686
687namespace tut
688{
689 class PumpAndChainTestData
690 {
691 protected:
692 apr_pool_t* mPool;
693 LLPumpIO* mPump;
694 LLPumpIO::chain_t mChain;
695
696 public:
697 PumpAndChainTestData()
698 {
699 apr_pool_create(&mPool, NULL);
700 mPump = new LLPumpIO(mPool);
701 }
702
703 ~PumpAndChainTestData()
704 {
705 mChain.clear();
706 delete mPump;
707 apr_pool_destroy(mPool);
708 }
709 };
710 typedef test_group<PumpAndChainTestData> PumpAndChainTestGroup;
711 typedef PumpAndChainTestGroup::object PumpAndChainTestObject;
712 PumpAndChainTestGroup pumpAndChainTestGroup("pump_and_chain");
713
714 template<> template<>
715 void PumpAndChainTestObject::test<1>()
716 {
717 LLPipeStringExtractor* extractor = new LLPipeStringExtractor();
718
719 mChain.push_back(LLIOPipe::ptr_t(new LLIOFlush));
720 mChain.push_back(LLIOPipe::ptr_t(extractor));
721
722 LLTimer timer;
723 timer.setTimerExpirySec(100.0f);
724
725 mPump->addChain(mChain, DEFAULT_CHAIN_EXPIRY_SECS);
726 while(!extractor->done() && !timer.hasExpired())
727 {
728 mPump->pump();
729 mPump->callback();
730 }
731
732 ensure("reading string finished", extractor->done());
733 ensure_equals("string was empty", extractor->string(), "");
734 }
735}
736
737/*
738namespace tut
739{
740 struct double_construct
741 {
742 public:
743 double_construct()
744 {
745 llinfos << "constructed" << llendl;
746 }
747 ~double_construct()
748 {
749 llinfos << "destroyed" << llendl;
750 }
751 };
752 typedef test_group<double_construct> double_construct_test_group;
753 typedef double_construct_test_group::object dc_test_object;
754 double_construct_test_group dctest("double construct");
755 template<> template<>
756 void dc_test_object::test<1>()
757 {
758 ensure("test 1", true);
759 }
760}
761*/
762
763namespace tut
764{
765 /**
766 * @brief we want to test the pipes & pumps under bad conditions.
767 */
768 struct pipe_and_pump_fitness
769 {
770 public:
771 enum
772 {
773 SERVER_LISTEN_PORT = 13050
774 };
775
776 pipe_and_pump_fitness()
777 {
778 LLFrameTimer::updateFrameTime();
779 apr_pool_create(&mPool, NULL);
780 mPump = new LLPumpIO(mPool);
781 mSocket = LLSocket::create(
782 mPool,
783 LLSocket::STREAM_TCP,
784 SERVER_LISTEN_PORT);
785 }
786
787 ~pipe_and_pump_fitness()
788 {
789 mSocket.reset();
790 delete mPump;
791 apr_pool_destroy(mPool);
792 }
793
794 protected:
795 apr_pool_t* mPool;
796 LLPumpIO* mPump;
797 LLSocket::ptr_t mSocket;
798 };
799 typedef test_group<pipe_and_pump_fitness> fitness_test_group;
800 typedef fitness_test_group::object fitness_test_object;
801 fitness_test_group fitness("pipe and pump fitness");
802
803 template<> template<>
804 void fitness_test_object::test<1>()
805 {
806 lldebugs << "fitness_test_object::test<1>()" << llendl;
807
808 // Set up the server
809 //lldebugs << "fitness_test_object::test<1> - setting up server."
810 // << llendl;
811 LLPumpIO::chain_t chain;
812 typedef LLCloneIOFactory<LLPipeStringInjector> emitter_t;
813 emitter_t* emitter = new emitter_t(
814 new LLPipeStringInjector("suckers never play me"));
815 boost::shared_ptr<LLChainIOFactory> factory(emitter);
816 LLIOServerSocket* server = new LLIOServerSocket(
817 mPool,
818 mSocket,
819 factory);
820 server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS);
821 chain.push_back(LLIOPipe::ptr_t(server));
822 mPump->addChain(chain, NEVER_CHAIN_EXPIRY_SECS);
823
824 // We need to tickle the pump a little to set up the listen()
825 //lldebugs << "fitness_test_object::test<1> - initializing server."
826 // << llendl;
827 pump_loop(mPump, 0.1f);
828
829 // Set up the client
830 //lldebugs << "fitness_test_object::test<1> - connecting client."
831 // << llendl;
832 LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP);
833 LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT);
834 bool connected = client->blockingConnect(server_host);
835 ensure("Connected to server", connected);
836 lldebugs << "connected" << llendl;
837
838 // We have connected, since the socket reader does not block,
839 // the first call to read data will return EAGAIN, so we need
840 // to write something.
841 chain.clear();
842 chain.push_back(LLIOPipe::ptr_t(new LLPipeStringInjector("hi")));
843 chain.push_back(LLIOPipe::ptr_t(new LLIOSocketWriter(client)));
844 chain.push_back(LLIOPipe::ptr_t(new LLIONull));
845 mPump->addChain(chain, 1.0f);
846
847 // Now, the server should immediately send the data, but we'll
848 // never read it. pump for a bit
849 F32 elapsed = pump_loop(mPump, 2.0f);
850 ensure("Did not take too long", (elapsed < 3.0f));
851 }
852
853 template<> template<>
854 void fitness_test_object::test<2>()
855 {
856 lldebugs << "fitness_test_object::test<2>()" << llendl;
857
858 // Set up the server
859 LLPumpIO::chain_t chain;
860 typedef LLCloneIOFactory<LLIOFuzz> emitter_t;
861 emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000));
862 boost::shared_ptr<LLChainIOFactory> factory(emitter);
863 LLIOServerSocket* server = new LLIOServerSocket(
864 mPool,
865 mSocket,
866 factory);
867 server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS);
868 chain.push_back(LLIOPipe::ptr_t(server));
869 mPump->addChain(chain, NEVER_CHAIN_EXPIRY_SECS);
870
871 // We need to tickle the pump a little to set up the listen()
872 pump_loop(mPump, 0.1f);
873
874 // Set up the client
875 LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP);
876 LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT);
877 bool connected = client->blockingConnect(server_host);
878 ensure("Connected to server", connected);
879 lldebugs << "connected" << llendl;
880
881 // We have connected, since the socket reader does not block,
882 // the first call to read data will return EAGAIN, so we need
883 // to write something.
884 chain.clear();
885 chain.push_back(LLIOPipe::ptr_t(new LLPipeStringInjector("hi")));
886 chain.push_back(LLIOPipe::ptr_t(new LLIOSocketWriter(client)));
887 chain.push_back(LLIOPipe::ptr_t(new LLIONull));
888 mPump->addChain(chain, SHORT_CHAIN_EXPIRY_SECS / 2.0f);
889
890 // Now, the server should immediately send the data, but we'll
891 // never read it. pump for a bit
892 F32 elapsed = pump_loop(mPump, SHORT_CHAIN_EXPIRY_SECS * 2.0f);
893 ensure("Did not take too long", (elapsed < 3.0f));
894 }
895
896 template<> template<>
897 void fitness_test_object::test<3>()
898 {
899 lldebugs << "fitness_test_object::test<3>()" << llendl;
900
901 // Set up the server
902 LLPumpIO::chain_t chain;
903 typedef LLCloneIOFactory<LLIOFuzz> emitter_t;
904 emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000));
905 boost::shared_ptr<LLChainIOFactory> factory(emitter);
906 LLIOServerSocket* server = new LLIOServerSocket(
907 mPool,
908 mSocket,
909 factory);
910 server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS);
911 chain.push_back(LLIOPipe::ptr_t(server));
912 mPump->addChain(chain, NEVER_CHAIN_EXPIRY_SECS);
913
914 // We need to tickle the pump a little to set up the listen()
915 pump_loop(mPump, 0.1f);
916
917 // Set up the client
918 LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP);
919 LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT);
920 bool connected = client->blockingConnect(server_host);
921 ensure("Connected to server", connected);
922 lldebugs << "connected" << llendl;
923
924 // We have connected, since the socket reader does not block,
925 // the first call to read data will return EAGAIN, so we need
926 // to write something.
927 chain.clear();
928 chain.push_back(LLIOPipe::ptr_t(new LLPipeStringInjector("hi")));
929 chain.push_back(LLIOPipe::ptr_t(new LLIOSocketWriter(client)));
930 chain.push_back(LLIOPipe::ptr_t(new LLIONull));
931 mPump->addChain(chain, SHORT_CHAIN_EXPIRY_SECS * 2.0f);
932
933 // Now, the server should immediately send the data, but we'll
934 // never read it. pump for a bit
935 F32 elapsed = pump_loop(mPump, SHORT_CHAIN_EXPIRY_SECS * 2.0f + 1.0f);
936 ensure("Did not take too long", (elapsed < 4.0f));
937 }
938
939 template<> template<>
940 void fitness_test_object::test<4>()
941 {
942 lldebugs << "fitness_test_object::test<4>()" << llendl;
943
944 // Set up the server
945 LLPumpIO::chain_t chain;
946 typedef LLCloneIOFactory<LLIOFuzz> emitter_t;
947 emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000));
948 boost::shared_ptr<LLChainIOFactory> factory(emitter);
949 LLIOServerSocket* server = new LLIOServerSocket(
950 mPool,
951 mSocket,
952 factory);
953 server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS + 2.0f);
954 chain.push_back(LLIOPipe::ptr_t(server));
955 mPump->addChain(chain, NEVER_CHAIN_EXPIRY_SECS);
956
957 // We need to tickle the pump a little to set up the listen()
958 pump_loop(mPump, 0.1f);
959
960 // Set up the client
961 LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP);
962 LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT);
963 bool connected = client->blockingConnect(server_host);
964 ensure("Connected to server", connected);
965 lldebugs << "connected" << llendl;
966
967 // We have connected, since the socket reader does not block,
968 // the first call to read data will return EAGAIN, so we need
969 // to write something.
970 chain.clear();
971 chain.push_back(LLIOPipe::ptr_t(new LLPipeStringInjector("hi")));
972 chain.push_back(LLIOPipe::ptr_t(new LLIOSocketWriter(client)));
973 chain.push_back(LLIOPipe::ptr_t(new LLIONull));
974 mPump->addChain(chain, NEVER_CHAIN_EXPIRY_SECS);
975
976 // Now, the server should immediately send the data, but we'll
977 // never read it. pump for a bit
978 F32 elapsed = pump_loop(mPump, SHORT_CHAIN_EXPIRY_SECS + 3.0f);
979 ensure("Did not take too long", (elapsed < DEFAULT_CHAIN_EXPIRY_SECS));
980 }
981}
982
983namespace tut
984{
985 struct rpc_server_data
986 {
987 class LLSimpleRPCResponse : public LLSDRPCResponse
988 {
989 public:
990 LLSimpleRPCResponse(LLSD* response) :
991 mResponsePtr(response)
992 {
993 }
994 ~LLSimpleRPCResponse() {}
995 virtual bool response(LLPumpIO* pump)
996 {
997 *mResponsePtr = mReturnValue;
998 return true;
999 }
1000 virtual bool fault(LLPumpIO* pump)
1001 {
1002 *mResponsePtr = mReturnValue;
1003 return false;
1004 }
1005 virtual bool error(LLPumpIO* pump)
1006 {
1007 ensure("LLSimpleRPCResponse::error()", false);
1008 return false;
1009 }
1010 public:
1011 LLSD* mResponsePtr;
1012 };
1013
1014 class LLSimpleRPCClient : public LLSDRPCClient
1015 {
1016 public:
1017 LLSimpleRPCClient(LLSD* response) :
1018 mResponsePtr(response)
1019 {
1020 }
1021 ~LLSimpleRPCClient() {}
1022 void echo(const LLSD& parameter)
1023 {
1024 LLSimpleRPCResponse* resp;
1025 resp = new LLSimpleRPCResponse(mResponsePtr);
1026 static const std::string URI_NONE;
1027 static const std::string METHOD_ECHO("echo");
1028 call(URI_NONE, METHOD_ECHO, parameter, resp, EPBQ_CALLBACK);
1029 }
1030 public:
1031 LLSD* mResponsePtr;
1032 };
1033
1034 class LLSimpleRPCServer : public LLSDRPCServer
1035 {
1036 public:
1037 LLSimpleRPCServer()
1038 {
1039 mMethods["echo"] = new mem_fn_t(
1040 this,
1041 &LLSimpleRPCServer::rpc_Echo);
1042 }
1043 ~LLSimpleRPCServer() {}
1044 protected:
1045 typedef LLSDRPCMethodCall<LLSimpleRPCServer> mem_fn_t;
1046 ESDRPCSStatus rpc_Echo(
1047 const LLSD& parameter,
1048 const LLChannelDescriptors& channels,
1049 LLBufferArray* data)
1050 {
1051 buildResponse(channels, data, parameter);
1052 return ESDRPCS_DONE;
1053 }
1054 };
1055
1056 apr_pool_t* mPool;
1057 LLPumpIO* mPump;
1058 LLPumpIO::chain_t mChain;
1059 LLSimpleRPCClient* mClient;
1060 LLSD mResponse;
1061
1062 rpc_server_data() :
1063 mPool(NULL),
1064 mPump(NULL),
1065 mClient(NULL)
1066 {
1067 apr_pool_create(&mPool, NULL);
1068 mPump = new LLPumpIO(mPool);
1069 mClient = new LLSimpleRPCClient(&mResponse);
1070 mChain.push_back(LLIOPipe::ptr_t(mClient));
1071 mChain.push_back(LLIOPipe::ptr_t(new LLFilterSD2XMLRPCRequest));
1072 mChain.push_back(LLIOPipe::ptr_t(new LLFilterXMLRPCRequest2LLSD));
1073 mChain.push_back(LLIOPipe::ptr_t(new LLSimpleRPCServer));
1074 mChain.push_back(LLIOPipe::ptr_t(new LLFilterSD2XMLRPCResponse));
1075 mChain.push_back(LLIOPipe::ptr_t(new LLFilterXMLRPCResponse2LLSD));
1076 mChain.push_back(LLIOPipe::ptr_t(mClient));
1077 }
1078 ~rpc_server_data()
1079 {
1080 mChain.clear();
1081 delete mPump;
1082 mPump = NULL;
1083 apr_pool_destroy(mPool);
1084 mPool = NULL;
1085 }
1086 void pump_loop(const LLSD& request)
1087 {
1088 LLTimer timer;
1089 timer.setTimerExpirySec(1.0f);
1090 mClient->echo(request);
1091 mPump->addChain(mChain, DEFAULT_CHAIN_EXPIRY_SECS);
1092 while(mResponse.isUndefined() && !timer.hasExpired())
1093 {
1094 mPump->pump();
1095 mPump->callback();
1096 }
1097 }
1098 };
1099 typedef test_group<rpc_server_data> rpc_server_test;
1100 typedef rpc_server_test::object rpc_server_object;
1101 tut::rpc_server_test rpc("rpc_server");
1102
1103 template<> template<>
1104 void rpc_server_object::test<1>()
1105 {
1106 LLSD request;
1107 request = 1;
1108 pump_loop(request);
1109 //llinfos << "request: " << *request << llendl;
1110 //llinfos << "response: " << *mResponse << llendl;
1111 ensure_equals("integer request response", mResponse.asInteger(), 1);
1112 }
1113
1114 template<> template<>
1115 void rpc_server_object::test<2>()
1116 {
1117 std::string uri("sl-am:66.150.244.180:12035/location?start=region&px=70.9247&py=254.378&pz=38.7304&lx=-0.043753&ly=-0.999042&lz=0");
1118 std::stringstream stream;
1119 stream << "{'task_id':ucc706f2d-0b68-68f8-11a4-f1043ff35ca0}\n{\n\tname\tObject|\n\tpermissions 0\n}";
1120 std::vector<U8> expected_binary;
1121 expected_binary.resize(stream.str().size());
1122 memcpy(&expected_binary[0], stream.str().c_str(), stream.str().size());
1123 stream.str("");
1124 stream << "[{'uri':'" << uri << "'}, {'version':i1}, "
1125 << "{'agent_id':'3c115e51-04f4-523c-9fa6-98aff1034730', 'session_id':'2c585cec-038c-40b0-b42e-a25ebab4d132', 'circuit_code':i1075, 'start':'region', 'limited_to_estate':i1 'first_name':'Phoenix', 'last_name':'Linden', 'group_title':'', 'group_id':u00000000-0000-0000-0000-000000000000, 'position':[r70.9247,r254.378,r38.7304], 'look_at':[r-0.043753,r-0.999042,r0], 'granters':[ua2e76fcd-9360-4f6d-a924-000000000003], 'texture_data':['5e481e8a-58a6-fc34-6e61-c7a36095c07f', 'c39675f5-ca90-a304-bb31-42cdb803a132', '5c989edf-88d1-b2ac-b00b-5ed4bab8e368', '6522e74d-1660-4e7f-b601-6f48c1659a77', '7ca39b4c-bd19-4699-aff7-f93fd03d3e7b', '41c58177-5eb6-5aeb-029d-bc4093f3c130', '97b75473-8b93-9b25-2a11-035b9ae93195', '1c2d8d9b-90eb-89d4-dea8-c1ed83990614', '69ec543f-e27b-c07c-9094-a8be6300f274', 'c9f8b80f-c629-4633-04ee-c566ce9fea4b', '989cddba-7ab6-01ed-67aa-74accd2a2a65', '45e319b2-6a8c-fa5c-895b-1a7149b88aef', '5748decc-f629-461c-9a36-a35a221fe21f', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', '685fbe10-ab40-f065-0aec-726cc6dfd7a1', '406f98fd-9c89-1d52-5f39-e67d508c5ee5', '685fbe10-ab40-f065-0aec-726cc6dfd7a1', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97'], "
1126 << "'attachment_data':["
1127 << "{'attachment_point':i2, 'item_id':'d6852c11-a74e-309a-0462-50533f1ef9b3', 'asset_id':'c69b29b1-8944-58ae-a7c5-2ca7b23e22fb'},"
1128 << "{'attachment_point':i10, 'item_id':'ff852c22-a74e-309a-0462-50533f1ef900', 'asset_data':b(" << expected_binary.size() << ")\"";
1129 stream.write((const char*)&expected_binary[0], expected_binary.size());
1130 stream << "\"}"
1131 << "]"
1132 << "}]";
1133
1134 LLSD request;
1135 S32 count = LLSDSerialize::fromNotation(request, stream);
1136 ensure("parsed something", (count > 0));
1137
1138 pump_loop(request);
1139 ensure_equals("return type", mResponse.type(), LLSD::TypeArray);
1140 ensure_equals("return size", mResponse.size(), 3);
1141
1142 ensure_equals(
1143 "uri parameter type",
1144 mResponse[0].type(),
1145 LLSD::TypeMap);
1146 ensure_equals(
1147 "uri type",
1148 mResponse[0]["uri"].type(),
1149 LLSD::TypeString);
1150 ensure_equals("uri value", mResponse[0]["uri"].asString(), uri);
1151
1152 ensure_equals(
1153 "version parameter type",
1154 mResponse[1].type(),
1155 LLSD::TypeMap);
1156 ensure_equals(
1157 "version type",
1158 mResponse[1]["version"].type(),
1159 LLSD::TypeInteger);
1160 ensure_equals(
1161 "version value",
1162 mResponse[1]["version"].asInteger(),
1163 1);
1164
1165 ensure_equals("agent params type", mResponse[2].type(), LLSD::TypeMap);
1166 LLSD attachment_data = mResponse[2]["attachment_data"];
1167 ensure("attachment data exists", attachment_data.isDefined());
1168 ensure_equals(
1169 "attachment type",
1170 attachment_data.type(),
1171 LLSD::TypeArray);
1172 ensure_equals(
1173 "attachment type 0",
1174 attachment_data[0].type(),
1175 LLSD::TypeMap);
1176 ensure_equals(
1177 "attachment type 1",
1178 attachment_data[1].type(),
1179 LLSD::TypeMap);
1180 ensure_equals("attachment size 1", attachment_data[1].size(), 3);
1181 ensure_equals(
1182 "asset data type",
1183 attachment_data[1]["asset_data"].type(),
1184 LLSD::TypeBinary);
1185 std::vector<U8> actual_binary;
1186 actual_binary = attachment_data[1]["asset_data"].asBinary();
1187 ensure_equals(
1188 "binary data size",
1189 actual_binary.size(),
1190 expected_binary.size());
1191 ensure(
1192 "binary data",
1193 (0 == memcmp(
1194 &actual_binary[0],
1195 &expected_binary[0],
1196 expected_binary.size())));
1197 }
1198
1199 template<> template<>
1200 void rpc_server_object::test<3>()
1201 {
1202 std::string uri("sl-am:66.150.244.180:12035/location?start=region&px=70.9247&py=254.378&pz=38.7304&lx=-0.043753&ly=-0.999042&lz=0");
1203
1204 LLBufferArray buffer;
1205 LLChannelDescriptors buffer_channels = buffer.nextChannel();
1206 LLBufferStream stream(buffer_channels, &buffer);
1207 stream << "[{'uri':'" << uri << "'}, {'version':i1}, "
1208 << "{'agent_id':'3c115e51-04f4-523c-9fa6-98aff1034730', 'session_id':'2c585cec-038c-40b0-b42e-a25ebab4d132', 'circuit_code':i1075, 'start':'region', 'limited_to_estate':i1 'first_name':'Phoenix', 'last_name':'Linden', 'group_title':'', 'group_id':u00000000-0000-0000-0000-000000000000, 'position':[r70.9247,r254.378,r38.7304], 'look_at':[r-0.043753,r-0.999042,r0], 'granters':[ua2e76fcd-9360-4f6d-a924-000000000003], 'texture_data':['5e481e8a-58a6-fc34-6e61-c7a36095c07f', 'c39675f5-ca90-a304-bb31-42cdb803a132', '5c989edf-88d1-b2ac-b00b-5ed4bab8e368', '6522e74d-1660-4e7f-b601-6f48c1659a77', '7ca39b4c-bd19-4699-aff7-f93fd03d3e7b', '41c58177-5eb6-5aeb-029d-bc4093f3c130', '97b75473-8b93-9b25-2a11-035b9ae93195', '1c2d8d9b-90eb-89d4-dea8-c1ed83990614', '69ec543f-e27b-c07c-9094-a8be6300f274', 'c9f8b80f-c629-4633-04ee-c566ce9fea4b', '989cddba-7ab6-01ed-67aa-74accd2a2a65', '45e319b2-6a8c-fa5c-895b-1a7149b88aef', '5748decc-f629-461c-9a36-a35a221fe21f', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', '685fbe10-ab40-f065-0aec-726cc6dfd7a1', '406f98fd-9c89-1d52-5f39-e67d508c5ee5', '685fbe10-ab40-f065-0aec-726cc6dfd7a1', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97'], "
1209 << "'attachment_data':["
1210 << "{'attachment_point':i2, 'item_id':'d6852c11-a74e-309a-0462-50533f1ef9b3', 'asset_id':'c69b29b1-8944-58ae-a7c5-2ca7b23e22fb'},";
1211
1212 std::stringstream tmp_str;
1213 tmp_str << "{'task_id':ucc706f2d-0b68-68f8-11a4-f1043ff35ca0}\n{\n\tname\tObject|\n\tpermissions 0\n}";
1214 std::vector<U8> expected_binary;
1215 expected_binary.resize(tmp_str.str().size());
1216 memcpy(
1217 &expected_binary[0],
1218 tmp_str.str().c_str(),
1219 tmp_str.str().size());
1220
1221 LLBufferArray attachment_buffer;
1222 LLChannelDescriptors attach_channels = attachment_buffer.nextChannel();
1223 LLBufferStream attach_stream(attach_channels, &attachment_buffer);
1224 attach_stream.write((const char*)&expected_binary[0], expected_binary.size());
1225 attach_stream.flush();
1226 S32 len = attachment_buffer.countAfter(attach_channels.out(), NULL);
1227 stream << "{'attachment_point':i10, 'item_id':'ff852c22-a74e-309a-0462-50533f1ef900', 'asset_data':b(" << len << ")\"";
1228 stream.flush();
1229 buffer.takeContents(attachment_buffer);
1230 stream << "\"}]}]";
1231 stream.flush();
1232
1233 LLChannelDescriptors read_channel = buffer.nextChannel();
1234 LLBufferStream read_stream(read_channel, &buffer);
1235 LLSD request;
1236 S32 count = LLSDSerialize::fromNotation(request, read_stream);
1237 ensure("parsed something", (count > 0));
1238 ensure("deserialized", request.isDefined());
1239
1240 // do the rpc round trip
1241 pump_loop(request);
1242
1243 ensure_equals("return type", mResponse.type(), LLSD::TypeArray);
1244 ensure_equals("return size", mResponse.size(), 3);
1245
1246 LLSD child = mResponse[0];
1247 ensure("uri map exists", child.isDefined());
1248 ensure_equals("uri parameter type", child.type(), LLSD::TypeMap);
1249 ensure("uri string exists", child.has("uri"));
1250 ensure_equals("uri type", child["uri"].type(), LLSD::TypeString);
1251 ensure_equals("uri value", child["uri"].asString(), uri);
1252
1253 child = mResponse[1];
1254 ensure("version map exists", child.isDefined());
1255 ensure_equals("version param type", child.type(), LLSD::TypeMap);
1256 ensure_equals(
1257 "version type",
1258 child["version"].type(),
1259 LLSD::TypeInteger);
1260 ensure_equals("version value", child["version"].asInteger(), 1);
1261
1262 child = mResponse[2];
1263 ensure("agent params map exists", child.isDefined());
1264 ensure_equals("agent params type", child.type(), LLSD::TypeMap);
1265 child = child["attachment_data"];
1266 ensure("attachment data exists", child.isDefined());
1267 ensure_equals("attachment type", child.type(), LLSD::TypeArray);
1268 LLSD attachment = child[0];
1269 ensure_equals("attachment type 0", attachment.type(), LLSD::TypeMap);
1270 attachment = child[1];
1271 ensure_equals("attachment type 1", attachment.type(), LLSD::TypeMap);
1272 ensure_equals("attachment size 1", attachment.size(), 3);
1273 ensure_equals(
1274 "asset data type",
1275 attachment["asset_data"].type(),
1276 LLSD::TypeBinary);
1277 std::vector<U8> actual_binary = attachment["asset_data"].asBinary();
1278 ensure_equals(
1279 "binary data size",
1280 actual_binary.size(),
1281 expected_binary.size());
1282 ensure(
1283 "binary data",
1284 (0 == memcmp(
1285 &actual_binary[0],
1286 &expected_binary[0],
1287 expected_binary.size())));
1288 }
1289
1290 template<> template<>
1291 void rpc_server_object::test<4>()
1292 {
1293 std::string message("parcel '' is naughty.");
1294 std::stringstream str;
1295 str << "{'message':'" << LLSDNotationFormatter::escapeString(message)
1296 << "'}";
1297 LLSD request;
1298 S32 count = LLSDSerialize::fromNotation(request, str);
1299 ensure_equals("parse count", count, 2);
1300 ensure_equals("request type", request.type(), LLSD::TypeMap);
1301 pump_loop(request);
1302 ensure("valid response", mResponse.isDefined());
1303 ensure_equals("response type", mResponse.type(), LLSD::TypeMap);
1304 std::string actual = mResponse["message"].asString();
1305 ensure_equals("message contents", actual, message);
1306 }
1307
1308 template<> template<>
1309 void rpc_server_object::test<5>()
1310 {
1311 // test some of the problem cases with llsdrpc over xmlrpc -
1312 // for example:
1313 // * arrays are auto-converted to parameter lists, thus, this
1314 // becomes one parameter.
1315 // * undef goes over the wire as false (this might not be a good idea)
1316 // * uuids are converted to string.
1317 std::string val = "[{'failures':!,'successfuls':[u3c115e51-04f4-523c-9fa6-98aff1034730]}]";
1318 std::istringstream istr;
1319 istr.str(val);
1320 LLSD sd;
1321 LLSDSerialize::fromNotation(sd, istr);
1322 pump_loop(sd);
1323 ensure("valid response", mResponse.isDefined());
1324 ensure_equals("parsed type", mResponse.type(), LLSD::TypeMap);
1325 ensure_equals("parsed size", mResponse.size(), 2);
1326 LLSD failures = mResponse["failures"];
1327 ensure_equals("no failures.", failures.asBoolean(), false);
1328 LLSD success = mResponse["successfuls"];
1329 ensure_equals("success type", success.type(), LLSD::TypeArray);
1330 ensure_equals("success size", success.size(), 1);
1331 ensure_equals(
1332 "success instance type",
1333 success[0].type(),
1334 LLSD::TypeString);
1335 }
1336
1337/*
1338 template<> template<>
1339 void rpc_server_object::test<5>()
1340 {
1341 std::string expected("\xf3");//\xffsomething");
1342 LLSD* request = LLSD::createString(expected);
1343 pump_loop(request);
1344 std::string actual;
1345 mResponse->getString(actual);
1346 if(actual != expected)
1347 {
1348 //llwarns << "iteration " << i << llendl;
1349 std::ostringstream e_str;
1350 std::string::iterator iter = expected.begin();
1351 std::string::iterator end = expected.end();
1352 for(; iter != end; ++iter)
1353 {
1354 e_str << (S32)((U8)(*iter)) << " ";
1355 }
1356 e_str << std::endl;
1357 llsd_serialize_string(e_str, expected);
1358 llwarns << "expected size: " << expected.size() << llendl;
1359 llwarns << "expected: " << e_str.str() << llendl;
1360
1361 std::ostringstream a_str;
1362 iter = actual.begin();
1363 end = actual.end();
1364 for(; iter != end; ++iter)
1365 {
1366 a_str << (S32)((U8)(*iter)) << " ";
1367 }
1368 a_str << std::endl;
1369 llsd_serialize_string(a_str, actual);
1370 llwarns << "actual size: " << actual.size() << llendl;
1371 llwarns << "actual: " << a_str.str() << llendl;
1372 }
1373 ensure_equals("binary string request response", actual, expected);
1374 delete request;
1375 }
1376
1377 template<> template<>
1378 void rpc_server_object::test<5>()
1379 {
1380 }
1381*/
1382}
1383
1384
1385/*
1386'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\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\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\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\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\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\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\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\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\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\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\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\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\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.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\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-6f25be3a3fd0}\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\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\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\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\tAttachItemID 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"
1387*/
diff --git a/linden/indra/test/llapp_tut.cpp b/linden/indra/test/llapp_tut.cpp
new file mode 100644
index 0000000..a238cb3
--- /dev/null
+++ b/linden/indra/test/llapp_tut.cpp
@@ -0,0 +1,153 @@
1/**
2 * @file llapp_tut.cpp
3 * @author Phoenix
4 * @date 2006-09-12
5 *
6 * Copyright (c) 2006-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#include <tut/tut.h>
30
31#include "linden_common.h"
32#include "llapp.h"
33#include "lltut.h"
34
35
36namespace tut
37{
38 struct application
39 {
40 class LLTestApp : public LLApp
41 {
42 public:
43 virtual bool init() { return true; }
44 virtual bool cleanup() { return true; }
45 virtual bool mainLoop() { return true; }
46 };
47 LLTestApp* mApp;
48 application()
49 {
50 mApp = new LLTestApp;
51 }
52 ~application()
53 {
54 delete mApp;
55 }
56 };
57
58 typedef test_group<application> application_t;
59 typedef application_t::object application_object_t;
60 tut::application_t tut_application("application");
61
62 template<> template<>
63 void application_object_t::test<1>()
64 {
65 LLSD defaults;
66 defaults["template"] = "../../scripts/messages/message_template.msg";
67 defaults["configdir"] = ".";
68 defaults["db_host"] = "mysql.durga.lindenlab.com";
69 defaults["db_user"] = "linden";
70 defaults["db_password"] = "gomez";
71 defaults["datadir"] = "data";
72 mApp->setOptionData(LLApp::PRIORITY_DEFAULT, defaults);
73
74 LLSD db_user_sd = mApp->getOption("db_user");
75 ensure_equals("data type", db_user_sd.type(), LLSD::TypeString);
76 ensure_equals(
77 "data value", db_user_sd.asString(), std::string("linden"));
78 }
79
80 template<> template<>
81 void application_object_t::test<2>()
82 {
83 const int ARGC = 13;
84 char* ARGV[ARGC] =
85 {
86 "", // argv[0] is usually the application name
87 "-crashcount",
88 "2",
89 "-space",
90 "spaceserver.grid.lindenlab.com",
91 "-db_host",
92 "localhost",
93 "--allowlslhttprequests",
94 "-asset-uri",
95 "http://asset.grid.lindenlab.com/assets",
96 "-data",
97 "127.0.0.1",
98 "--smtp"
99 };
100 bool ok = mApp->parseCommandOptions(ARGC, ARGV);
101 ensure("command line parsed", ok);
102 ensure_equals(
103 "crashcount", mApp->getOption("crashcount").asInteger(), 2);
104 ensure_equals(
105 "space",
106 mApp->getOption("space").asString(),
107 std::string("spaceserver.grid.lindenlab.com"));
108 ensure_equals(
109 "db_host",
110 mApp->getOption("db_host").asString(),
111 std::string("localhost"));
112 ensure("allowlshlttprequests", mApp->getOption("smtp"));
113 ensure_equals(
114 "asset-uri",
115 mApp->getOption("asset-uri").asString(),
116 std::string("http://asset.grid.lindenlab.com/assets"));
117 ensure_equals(
118 "data",
119 mApp->getOption("data").asString(),
120 std::string("127.0.0.1"));
121 ensure("smtp", mApp->getOption("smtp"));
122 }
123
124 template<> template<>
125 void application_object_t::test<3>()
126 {
127 const int ARGC = 4;
128 char* ARGV[ARGC] =
129 {
130 "", // argv[0] is usually the application name
131 "crashcount",
132 "2",
133 "--space"
134 };
135 bool ok = mApp->parseCommandOptions(ARGC, ARGV);
136 ensure("command line parse failure", !ok);
137 }
138
139 template<> template<>
140 void application_object_t::test<4>()
141 {
142 const int ARGC = 4;
143 char* ARGV[ARGC] =
144 {
145 "", // argv[0] is usually the application name
146 "--crashcount",
147 "2",
148 "space"
149 };
150 bool ok = mApp->parseCommandOptions(ARGC, ARGV);
151 ensure("command line parse failure", !ok);
152 }
153}
diff --git a/linden/indra/test/llhttpclient_tut.cpp b/linden/indra/test/llhttpclient_tut.cpp
new file mode 100644
index 0000000..c84d34b
--- /dev/null
+++ b/linden/indra/test/llhttpclient_tut.cpp
@@ -0,0 +1,315 @@
1/**
2 * @file llhttpclient_tut.cpp
3 * @brief Testing the HTTP client classes.
4 *
5 * Copyright (c) 2006-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28/**
29 *
30 * These classes test the HTTP client framework.
31 *
32 */
33
34#include <tut/tut.h>
35#include "lltut.h"
36
37#include "llhttpclient.h"
38#include "llpipeutil.h"
39#include "llpumpio.h"
40
41#include "llsdhttpserver.h"
42#include "lliohttpserver.h"
43#include "lliosocket.h"
44
45namespace tut
46{
47 LLSD storage;
48
49 class LLSDStorageNode : public LLHTTPNode
50 {
51 public:
52 LLSD get() const { return storage; }
53 LLSD put(const LLSD& value) const { storage = value; return LLSD(); }
54 };
55
56 class ErrorNode : public LLHTTPNode
57 {
58 public:
59 void get(ResponsePtr r, const LLSD& context) const
60 { r->status(599, "Intentional error"); }
61 void post(ResponsePtr r, const LLSD& context, const LLSD& input) const
62 { r->status(input["status"], input["reason"]); }
63 };
64
65 class TimeOutNode : public LLHTTPNode
66 {
67 public:
68 void get(ResponsePtr r, const LLSD& context) const
69 {
70 /* do nothing, the request will eventually time out */
71 }
72 };
73
74 LLHTTPRegistration<LLSDStorageNode> gStorageNode("/test/storage");
75 LLHTTPRegistration<ErrorNode> gErrorNode("/test/error");
76 LLHTTPRegistration<TimeOutNode> gTimeOutNode("/test/timeout");
77
78 struct HTTPClientTestData
79 {
80 public:
81 HTTPClientTestData()
82 {
83 apr_pool_create(&mPool, NULL);
84 mServerPump = new LLPumpIO(mPool);
85 mClientPump = new LLPumpIO(mPool);
86
87 LLHTTPClient::setPump(*mClientPump);
88 }
89
90 ~HTTPClientTestData()
91 {
92 delete mServerPump;
93 delete mClientPump;
94 apr_pool_destroy(mPool);
95 }
96
97 void setupTheServer()
98 {
99 LLHTTPNode& root = LLCreateHTTPServer(mPool, *mServerPump, 8888);
100
101 LLHTTPStandardServices::useServices();
102 LLHTTPRegistrar::buildAllServices(root);
103 }
104
105 void runThePump(float timeout = 100.0f)
106 {
107 LLTimer timer;
108 timer.setTimerExpirySec(timeout);
109
110 while(!mSawCompleted && !timer.hasExpired())
111 {
112 if (mServerPump)
113 {
114 mServerPump->pump();
115 mServerPump->callback();
116 }
117 if (mClientPump)
118 {
119 mClientPump->pump();
120 mClientPump->callback();
121 }
122 }
123 }
124
125 void killServer()
126 {
127 delete mServerPump;
128 mServerPump = NULL;
129 }
130
131 private:
132 apr_pool_t* mPool;
133 LLPumpIO* mServerPump;
134 LLPumpIO* mClientPump;
135
136
137 protected:
138 void ensureStatusOK()
139 {
140 if (mSawError)
141 {
142 std::string msg =
143 llformat("error() called when not expected, status %d",
144 mStatus);
145 fail(msg);
146 }
147 }
148
149 void ensureStatusError()
150 {
151 if (!mSawError)
152 {
153 fail("error() wasn't called");
154 }
155 }
156
157 LLSD getResult()
158 {
159 return mResult;
160 }
161
162 protected:
163 bool mSawError;
164 U32 mStatus;
165 std::string mReason;
166 bool mSawCompleted;
167 LLSD mResult;
168 bool mResultDeleted;
169
170 class Result : public LLHTTPClient::Responder
171 {
172 protected:
173 Result(HTTPClientTestData& client)
174 : mClient(client)
175 {
176 }
177
178 public:
179 static boost::intrusive_ptr<Result> build(HTTPClientTestData& client)
180 {
181 return boost::intrusive_ptr<Result>(new Result(client));
182 }
183
184 ~Result()
185 {
186 mClient.mResultDeleted = true;
187 }
188
189 virtual void error(U32 status, const std::string& reason)
190 {
191 mClient.mSawError = true;
192 mClient.mStatus = status;
193 mClient.mReason = reason;
194 }
195
196 virtual void result(const LLSD& content)
197 {
198 mClient.mResult = content;
199 }
200
201 virtual void completed(
202 U32 status, const std::string& reason,
203 const LLSD& content)
204 {
205 LLHTTPClient::Responder::completed(status, reason, content);
206
207 mClient.mSawCompleted = true;
208 }
209
210 private:
211 HTTPClientTestData& mClient;
212 };
213
214 friend class Result;
215
216 protected:
217 LLHTTPClient::ResponderPtr newResult()
218 {
219 mSawError = false;
220 mStatus = 0;
221 mSawCompleted = false;
222 mResult.clear();
223 mResultDeleted = false;
224
225 return Result::build(*this);
226 }
227 };
228
229
230 typedef test_group<HTTPClientTestData> HTTPClientTestGroup;
231 typedef HTTPClientTestGroup::object HTTPClientTestObject;
232 HTTPClientTestGroup httpClientTestGroup("http_client");
233
234 template<> template<>
235 void HTTPClientTestObject::test<1>()
236 {
237 LLHTTPClient::get("http://www.google.com/", newResult());
238 runThePump();
239 ensureStatusOK();
240 ensure("result object wasn't destroyed", mResultDeleted);
241 }
242
243 template<> template<>
244 void HTTPClientTestObject::test<2>()
245 {
246 LLHTTPClient::get("http://www.invalid", newResult());
247 runThePump();
248 ensureStatusError();
249 }
250
251 template<> template<>
252 void HTTPClientTestObject::test<3>()
253 {
254 LLSD sd;
255
256 sd["list"][0]["one"] = 1;
257 sd["list"][0]["two"] = 2;
258 sd["list"][1]["three"] = 3;
259 sd["list"][1]["four"] = 4;
260
261 setupTheServer();
262
263 LLHTTPClient::post("http://localhost:8888/web/echo", sd, newResult());
264 runThePump();
265 ensureStatusOK();
266 ensure_equals("echoed result matches", getResult(), sd);
267 }
268
269 template<> template<>
270 void HTTPClientTestObject::test<4>()
271 {
272 LLSD sd;
273
274 sd["message"] = "This is my test message.";
275
276 setupTheServer();
277 LLHTTPClient::put("http://localhost:8888/test/storage", sd, newResult());
278 runThePump();
279 ensureStatusOK();
280
281 LLHTTPClient::get("http://localhost:8888/test/storage", newResult());
282 runThePump();
283 ensureStatusOK();
284 ensure_equals("echoed result matches", getResult(), sd);
285
286 }
287
288 template<> template<>
289 void HTTPClientTestObject::test<5>()
290 {
291 LLSD sd;
292 sd["status"] = 543;
293 sd["reason"] = "error for testing";
294
295 setupTheServer();
296
297 LLHTTPClient::post("http://localhost:8888/test/error", sd, newResult());
298 runThePump();
299 ensureStatusError();
300 ensure_contains("reason", mReason, sd["reason"]);
301 }
302
303 template<> template<>
304 void HTTPClientTestObject::test<6>()
305 {
306 setupTheServer();
307
308 LLHTTPClient::get("http://localhost:8888/test/timeout", newResult());
309 runThePump(1.0f);
310 killServer();
311 runThePump();
312 ensureStatusError();
313 ensure_equals("reason", mReason, "STATUS_ERROR");
314 }
315}
diff --git a/linden/indra/test/llhttpnode_tut.cpp b/linden/indra/test/llhttpnode_tut.cpp
new file mode 100644
index 0000000..006ba09
--- /dev/null
+++ b/linden/indra/test/llhttpnode_tut.cpp
@@ -0,0 +1,428 @@
1/**
2 * @file lliohttpserver_tut.cpp
3 * @date May 2006
4 * @brief HTTP server unit tests
5 *
6 * Copyright (c) 2006-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#include <tut/tut.h>
30#include "lltut.h"
31
32#include "llhttpnode.h"
33#include "llsdhttpserver.h"
34
35namespace tut
36{
37 struct HTTPNodeTestData
38 {
39 LLHTTPNode mRoot;
40 LLSD mContext;
41
42 const LLSD& context() { return mContext; }
43
44 std::string remainderPath()
45 {
46 std::ostringstream pathOutput;
47 bool addSlash = false;
48
49 LLSD& remainder = mContext["request"]["remainder"];
50 for (LLSD::array_const_iterator i = remainder.beginArray();
51 i != remainder.endArray();
52 ++i)
53 {
54 if (addSlash) { pathOutput << '/'; }
55 pathOutput << i->asString();
56 addSlash = true;
57 }
58
59 return pathOutput.str();
60 }
61
62 void ensureRootTraversal(const std::string& path,
63 const LLHTTPNode* expectedNode,
64 const char* expectedRemainder)
65 {
66 mContext.clear();
67
68 const LLHTTPNode* actualNode = mRoot.traverse(path, mContext);
69
70 ensure_equals("traverse " + path + " node",
71 actualNode, expectedNode);
72 ensure_equals("traverse " + path + " remainder",
73 remainderPath(), expectedRemainder);
74 }
75
76 class Response : public LLHTTPNode::Response
77 {
78 public:
79 static LLPointer<Response> create() {return new Response();}
80
81 LLSD mResult;
82
83 void result(const LLSD& result) { mResult = result; }
84 void status(S32 code, const std::string& message) { }
85
86 private:
87 Response() {;} // Must be accessed through LLPointer.
88 };
89
90 typedef LLPointer<Response> ResponsePtr;
91
92 LLSD get(const std::string& path)
93 {
94 mContext.clear();
95 const LLHTTPNode* node = mRoot.traverse(path, mContext);
96 ensure(path + " found", node != NULL);
97
98 ResponsePtr response = Response::create();
99 node->get(LLHTTPNode::ResponsePtr(response), mContext);
100 return response->mResult;
101 }
102
103 LLSD post(const std::string& path, const LLSD& input)
104 {
105 mContext.clear();
106 const LLHTTPNode* node = mRoot.traverse(path, mContext);
107 ensure(path + " found", node != NULL);
108
109 ResponsePtr response = Response::create();
110 node->post(LLHTTPNode::ResponsePtr(response), mContext, input);
111 return response->mResult;
112 }
113
114 void ensureMemberString(const std::string& name,
115 const LLSD& actualMap, const std::string& member,
116 const std::string& expectedValue)
117 {
118 ensure_equals(name + " " + member,
119 actualMap[member].asString(), expectedValue);
120 }
121
122
123 void ensureInArray(const LLSD& actualArray,
124 const std::string& expectedValue)
125 {
126 LLSD::array_const_iterator i = actualArray.beginArray();
127 LLSD::array_const_iterator end = actualArray.endArray();
128
129 for (; i != end; ++i)
130 {
131 std::string path = i->asString();
132
133 if (path == expectedValue)
134 {
135 return;
136 }
137 }
138
139 fail("didn't find " + expectedValue);
140 }
141
142 };
143
144 typedef test_group<HTTPNodeTestData> HTTPNodeTestGroup;
145 typedef HTTPNodeTestGroup::object HTTPNodeTestObject;
146 HTTPNodeTestGroup httpNodeTestGroup("http node");
147
148 template<> template<>
149 void HTTPNodeTestObject::test<1>()
150 {
151 // traversal of the lone node
152
153 ensureRootTraversal("", &mRoot, "");
154 ensureRootTraversal("/", &mRoot, "");
155 ensureRootTraversal("foo", NULL, "foo");
156 ensureRootTraversal("foo/bar", NULL, "foo/bar");
157
158 ensure_equals("root of root", mRoot.rootNode(), &mRoot);
159 }
160
161 template<> template<>
162 void HTTPNodeTestObject::test<2>()
163 {
164 // simple traversal of a single node
165
166 LLHTTPNode* helloNode = new LLHTTPNode;
167 mRoot.addNode("hello", helloNode);
168
169 ensureRootTraversal("hello", helloNode, "");
170 ensureRootTraversal("/hello", helloNode, "");
171 ensureRootTraversal("hello/", helloNode, "");
172 ensureRootTraversal("/hello/", helloNode, "");
173
174 ensureRootTraversal("hello/there", NULL, "there");
175
176 ensure_equals("root of hello", helloNode->rootNode(), &mRoot);
177 }
178
179 template<> template<>
180 void HTTPNodeTestObject::test<3>()
181 {
182 // traversal of mutli-branched tree
183
184 LLHTTPNode* greekNode = new LLHTTPNode;
185 LLHTTPNode* alphaNode = new LLHTTPNode;
186 LLHTTPNode* betaNode = new LLHTTPNode;
187 LLHTTPNode* gammaNode = new LLHTTPNode;
188
189 greekNode->addNode("alpha", alphaNode);
190 greekNode->addNode("beta", betaNode);
191 greekNode->addNode("gamma", gammaNode);
192 mRoot.addNode("greek", greekNode);
193
194 LLHTTPNode* hebrewNode = new LLHTTPNode;
195 LLHTTPNode* alephNode = new LLHTTPNode;
196
197 hebrewNode->addNode("aleph", alephNode);
198 mRoot.addNode("hebrew", hebrewNode);
199
200 ensureRootTraversal("greek/alpha", alphaNode, "");
201 ensureRootTraversal("greek/beta", betaNode, "");
202 ensureRootTraversal("greek/delta", NULL, "delta");
203 ensureRootTraversal("greek/gamma", gammaNode, "");
204 ensureRootTraversal("hebrew/aleph", alephNode, "");
205
206 ensure_equals("root of greek", greekNode->rootNode(), &mRoot);
207 ensure_equals("root of alpha", alphaNode->rootNode(), &mRoot);
208 ensure_equals("root of beta", betaNode->rootNode(), &mRoot);
209 ensure_equals("root of gamma", gammaNode->rootNode(), &mRoot);
210 ensure_equals("root of hebrew", hebrewNode->rootNode(), &mRoot);
211 ensure_equals("root of aleph", alephNode->rootNode(), &mRoot);
212 }
213
214 template<> template<>
215 void HTTPNodeTestObject::test<4>()
216 {
217 // automatic creation of parent nodes and not overriding existing nodes
218
219 LLHTTPNode* alphaNode = new LLHTTPNode;
220 LLHTTPNode* betaNode = new LLHTTPNode;
221 LLHTTPNode* gammaNode = new LLHTTPNode;
222 LLHTTPNode* gamma2Node = new LLHTTPNode;
223
224 mRoot.addNode("greek/alpha", alphaNode);
225 mRoot.addNode("greek/beta", betaNode);
226
227 mRoot.addNode("greek/gamma", gammaNode);
228 mRoot.addNode("greek/gamma", gamma2Node);
229
230 LLHTTPNode* alephNode = new LLHTTPNode;
231
232 mRoot.addNode("hebrew/aleph", alephNode);
233
234 ensureRootTraversal("greek/alpha", alphaNode, "");
235 ensureRootTraversal("greek/beta", betaNode, "");
236 ensureRootTraversal("greek/delta", NULL, "delta");
237 ensureRootTraversal("greek/gamma", gammaNode, "");
238 ensureRootTraversal("hebrew/aleph", alephNode, "");
239
240 ensure_equals("root of alpha", alphaNode->rootNode(), &mRoot);
241 ensure_equals("root of beta", betaNode->rootNode(), &mRoot);
242 ensure_equals("root of gamma", gammaNode->rootNode(), &mRoot);
243 ensure_equals("root of aleph", alephNode->rootNode(), &mRoot);
244 }
245
246 class IntegerNode : public LLHTTPNode
247 {
248 public:
249 virtual void get(ResponsePtr response, const LLSD& context) const
250 {
251 int n = context["extra"]["value"];
252
253 LLSD info;
254 info["value"] = n;
255 info["positive"] = n > 0;
256 info["zero"] = n == 0;
257 info["negative"] = n < 0;
258
259 response->result(info);
260 }
261
262 virtual bool validate(const std::string& name, LLSD& context) const
263 {
264 int n;
265 std::istringstream i_stream(name);
266 i_stream >> n;
267
268 if (i_stream.fail() || i_stream.get() != EOF)
269 {
270 return false;
271 }
272
273 context["extra"]["value"] = n;
274 return true;
275 }
276 };
277
278 class SquareNode : public LLHTTPNode
279 {
280 public:
281 virtual void get(ResponsePtr response, const LLSD& context) const
282 {
283 int n = context["extra"]["value"];
284 response->result(n*n);
285 }
286 };
287
288 template<> template<>
289 void HTTPNodeTestObject::test<5>()
290 {
291 // wildcard nodes
292
293 LLHTTPNode* miscNode = new LLHTTPNode;
294 LLHTTPNode* iNode = new IntegerNode;
295 LLHTTPNode* sqNode = new SquareNode;
296
297 mRoot.addNode("test/misc", miscNode);
298 mRoot.addNode("test/<int>", iNode);
299 mRoot.addNode("test/<int>/square", sqNode);
300
301 ensureRootTraversal("test/42", iNode, "");
302 ensure_equals("stored integer",
303 context()["extra"]["value"].asInteger(), 42);
304
305 ensureRootTraversal("test/bob", NULL, "bob");
306 ensure("nothing stored",
307 context()["extra"]["value"].isUndefined());
308
309 ensureRootTraversal("test/3/square", sqNode, "");
310 ResponsePtr response = Response::create();
311 sqNode->get(LLHTTPNode::ResponsePtr(response), context());
312 ensure_equals("square result", response->mResult.asInteger(), 9);
313 }
314
315 class AlphaNode : public LLHTTPNode
316 {
317 public:
318 virtual bool handles(const LLSD& remainder, LLSD& context) const
319 {
320 LLSD::array_const_iterator i = remainder.beginArray();
321 LLSD::array_const_iterator end = remainder.endArray();
322
323 for (; i != end; ++i)
324 {
325 std::string s = i->asString();
326 if (s.empty() || s[0] != 'a')
327 {
328 return false;
329 }
330 }
331
332 return true;
333 }
334 };
335
336 template<> template<>
337 void HTTPNodeTestObject::test<6>()
338 {
339 // nodes that handle remainders
340
341 LLHTTPNode* miscNode = new LLHTTPNode;
342 LLHTTPNode* aNode = new AlphaNode;
343 LLHTTPNode* zNode = new LLHTTPNode;
344
345 mRoot.addNode("test/misc", miscNode);
346 mRoot.addNode("test/alpha", aNode);
347 mRoot.addNode("test/alpha/zebra", zNode);
348
349 ensureRootTraversal("test/alpha", aNode, "");
350 ensureRootTraversal("test/alpha/abe", aNode, "abe");
351 ensureRootTraversal("test/alpha/abe/amy", aNode, "abe/amy");
352 ensureRootTraversal("test/alpha/abe/bea", NULL, "abe/bea");
353 ensureRootTraversal("test/alpha/bob", NULL, "bob");
354 ensureRootTraversal("test/alpha/zebra", zNode, "");
355 }
356
357 template<> template<>
358 void HTTPNodeTestObject::test<7>()
359 {
360 // test auto registration
361
362 LLHTTPStandardServices::useServices();
363 LLHTTPRegistrar::buildAllServices(mRoot);
364
365 {
366 LLSD result = get("web/hello");
367 ensure_equals("hello result", result.asString(), "hello");
368 }
369 {
370 LLSD stuff = 3.14159;
371 LLSD result = post("web/echo", stuff);
372 ensure_equals("echo result", result, stuff);
373 }
374 }
375
376 template<> template<>
377 void HTTPNodeTestObject::test<8>()
378 {
379 // test introspection
380
381 LLHTTPRegistrar::buildAllServices(mRoot);
382
383 mRoot.addNode("test/misc", new LLHTTPNode);
384 mRoot.addNode("test/<int>", new IntegerNode);
385 mRoot.addNode("test/<int>/square", new SquareNode);
386
387 const LLSD result = get("web/server/api");
388
389 ensure("result is array", result.isArray());
390 ensure("result size", result.size() >= 2);
391
392 ensureInArray(result, "web/echo");
393 ensureInArray(result, "web/hello");
394 ensureInArray(result, "test/misc");
395 ensureInArray(result, "test/<int>");
396 ensureInArray(result, "test/<int>/square");
397 }
398
399 template<> template<>
400 void HTTPNodeTestObject::test<9>()
401 {
402 // test introspection details
403
404 LLHTTPRegistrar::buildAllServices(mRoot);
405
406 const LLSD helloDetails = get("web/server/api/web/hello");
407
408 ensure_contains("hello description",
409 helloDetails["description"].asString(), "hello");
410 ensure_equals("method name", helloDetails["api"][0].asString(), std::string("GET"));
411 ensureMemberString("hello", helloDetails, "output", "\"hello\"");
412 ensure_contains("hello __file__",
413 helloDetails["__file__"].asString(), "llsdhttpserver.cpp");
414 ensure("hello line", helloDetails["__line__"].isInteger());
415
416
417 const LLSD echoDetails = get("web/server/api/web/echo");
418
419 ensure_contains("echo description",
420 echoDetails["description"].asString(), "echo");
421 ensure_equals("method name", echoDetails["api"][0].asString(), std::string("POST"));
422 ensureMemberString("echo", echoDetails, "input", "<any>");
423 ensureMemberString("echo", echoDetails, "output", "<the input>");
424 ensure_contains("echo __file__",
425 echoDetails["__file__"].asString(), "llsdhttpserver.cpp");
426 ensure("echo", echoDetails["__line__"].isInteger());
427 }
428}
diff --git a/linden/indra/test/lliohttpserver_tut.cpp b/linden/indra/test/lliohttpserver_tut.cpp
new file mode 100644
index 0000000..1cc94bb
--- /dev/null
+++ b/linden/indra/test/lliohttpserver_tut.cpp
@@ -0,0 +1,303 @@
1/**
2 * @file lliohttpserver_tut.cpp
3 * @date May 2006
4 * @brief HTTP server unit tests
5 *
6 * Copyright (c) 2006-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#include <tut/tut.h>
30#include "lltut.h"
31
32#include "llbufferstream.h"
33#include "lliohttpserver.h"
34#include "llsdhttpserver.h"
35#include "llsdserialize.h"
36
37#include "llpipeutil.h"
38
39
40namespace tut
41{
42 class HTTPServiceTestData
43 {
44 public:
45 class DelayedEcho : public LLHTTPNode
46 {
47 HTTPServiceTestData* mTester;
48
49 public:
50 DelayedEcho(HTTPServiceTestData* tester) : mTester(tester) { }
51
52 void post(ResponsePtr response, const LLSD& context, const LLSD& input) const
53 {
54 ensure("response already set", mTester->mResponse == ResponsePtr(NULL));
55 mTester->mResponse = response;
56 mTester->mResult = input;
57 }
58 };
59
60 class WireHello : public LLIOPipe
61 {
62 protected:
63 virtual EStatus process_impl(
64 const LLChannelDescriptors& channels,
65 buffer_ptr_t& buffer,
66 bool& eos,
67 LLSD& context,
68 LLPumpIO* pump)
69 {
70 if(!eos) return STATUS_BREAK;
71 LLSD sd = "yo!";
72 LLBufferStream ostr(channels, buffer.get());
73 ostr << LLSDXMLStreamer(sd);
74 return STATUS_DONE;
75 }
76 };
77
78 HTTPServiceTestData()
79 : mResponse(NULL)
80 {
81 LLHTTPStandardServices::useServices();
82 LLHTTPRegistrar::buildAllServices(mRoot);
83 mRoot.addNode("/delayed/echo", new DelayedEcho(this));
84 mRoot.addNode("/wire/hello", new LLHTTPNodeForPipe<WireHello>);
85 }
86
87 LLHTTPNode mRoot;
88 LLHTTPNode::ResponsePtr mResponse;
89 LLSD mResult;
90
91 void pumpPipe(LLPumpIO* pump, S32 iterations)
92 {
93 while(iterations > 0)
94 {
95 pump->pump();
96 pump->callback();
97 --iterations;
98 }
99 }
100
101 std::string makeRequest(
102 const std::string& name,
103 const std::string& httpRequest,
104 bool timeout = false)
105 {
106 LLPipeStringInjector* injector = new LLPipeStringInjector(httpRequest);
107 LLPipeStringExtractor* extractor = new LLPipeStringExtractor();
108
109 apr_pool_t* pool;
110 apr_pool_create(&pool, NULL);
111
112 LLPumpIO* pump;
113 pump = new LLPumpIO(pool);
114
115 LLPumpIO::chain_t chain;
116 LLSD context;
117
118 chain.push_back(LLIOPipe::ptr_t(injector));
119 LLCreateHTTPPipe(chain, mRoot);
120 chain.push_back(LLIOPipe::ptr_t(extractor));
121
122 pump->addChain(chain, DEFAULT_CHAIN_EXPIRY_SECS);
123
124 pumpPipe(pump, 10);
125 if(mResponse && (! timeout))
126 {
127 mResponse->result(mResult);
128 mResponse = NULL;
129 }
130 pumpPipe(pump, 10);
131
132 std::string httpResult = extractor->string();
133
134 chain.clear();
135 delete pump;
136 apr_pool_destroy(pool);
137
138 if(mResponse && timeout)
139 {
140 mResponse->result(mResult);
141 mResponse = NULL;
142 }
143
144 return httpResult;
145 }
146
147 std::string httpGET(const std::string& uri,
148 bool timeout = false)
149 {
150 std::string httpRequest = "GET " + uri + " HTTP/1.0\r\n\r\n";
151 return makeRequest(uri, httpRequest, timeout);
152 }
153
154 std::string httpPOST(const std::string& uri,
155 const std::string& body,
156 bool timeout,
157 const std::string& evilExtra = "")
158 {
159 std::ostringstream httpRequest;
160 httpRequest << "POST " + uri + " HTTP/1.0\r\n";
161 httpRequest << "Content-Length: " << body.size() << "\r\n";
162 httpRequest << "\r\n";
163 httpRequest << body;
164 httpRequest << evilExtra;
165
166 return makeRequest(uri, httpRequest.str(), timeout);
167 }
168
169 std::string httpPOST(const std::string& uri,
170 const std::string& body,
171 const std::string& evilExtra = "")
172 {
173 bool timeout = false;
174 return httpPOST(uri, body, timeout, evilExtra);
175 }
176 };
177
178 typedef test_group<HTTPServiceTestData> HTTPServiceTestGroup;
179 typedef HTTPServiceTestGroup::object HTTPServiceTestObject;
180 HTTPServiceTestGroup httpServiceTestGroup("http service");
181
182 template<> template<>
183 void HTTPServiceTestObject::test<1>()
184 {
185 std::string result = httpGET("web/hello");
186
187 ensure_starts_with("web/hello status", result,
188 "HTTP/1.0 200 OK\r\n");
189
190 ensure_contains("web/hello content type", result,
191 "Content-Type: application/xml\r\n");
192
193 ensure_contains("web/hello content length", result,
194 "Content-Length: 36\r\n");
195
196 ensure_contains("web/hello content", result,
197 "\r\n"
198 "<llsd><string>hello</string></llsd>"
199 );
200 }
201
202 template<> template<>
203 void HTTPServiceTestObject::test<2>()
204 {
205 // test various HTTP errors
206
207 std::string actual;
208
209 actual = httpGET("web/missing");
210 ensure_starts_with("web/missing 404", actual,
211 "HTTP/1.0 404 Not Found\r\n");
212
213 actual = httpGET("web/echo");
214 ensure_starts_with("web/echo 405", actual,
215 "HTTP/1.0 405 Method Not Allowed\r\n");
216 }
217
218 template<> template<>
219 void HTTPServiceTestObject::test<3>()
220 {
221 // test POST & content-length handling
222
223 std::string result;
224
225 result = httpPOST("web/echo",
226 "<llsd><integer>42</integer></llsd>");
227
228 ensure_starts_with("web/echo status", result,
229 "HTTP/1.0 200 OK\r\n");
230
231 ensure_contains("web/echo content type", result,
232 "Content-Type: application/xml\r\n");
233
234 ensure_contains("web/echo content length", result,
235 "Content-Length: 35\r\n");
236
237 ensure_contains("web/hello content", result,
238 "\r\n"
239 "<llsd><integer>42</integer></llsd>"
240 );
241
242/* TO DO: this test doesn't pass!!
243
244 result = httpPOST("web/echo",
245 "<llsd><string>evil</string></llsd>",
246 "really! evil!!!");
247
248 ensure_equals("web/echo evil result", result,
249 "HTTP/1.0 200 OK\r\n"
250 "Content-Length: 34\r\n"
251 "\r\n"
252 "<llsd><string>evil</string></llsd>"
253 );
254*/
255 }
256
257 template<> template<>
258 void HTTPServiceTestObject::test<4>()
259 {
260 // test calling things based on pipes
261
262 std::string result;
263
264 result = httpGET("wire/hello");
265
266 ensure_contains("wire/hello", result, "yo!");
267 }
268
269 template<> template<>
270 void HTTPServiceTestObject::test<5>()
271 {
272 // test timeout before async response
273 std::string result;
274
275 bool timeout = true;
276 result = httpPOST("delayed/echo",
277 "<llsd><string>agent99</string></llsd>", timeout);
278
279 ensure_equals("timeout delayed/echo status", result, std::string(""));
280 }
281
282 template<> template<>
283 void HTTPServiceTestObject::test<6>()
284 {
285 // test delayed service
286 std::string result;
287
288 result = httpPOST("delayed/echo",
289 "<llsd><string>agent99</string></llsd>");
290
291 ensure_starts_with("delayed/echo status", result,
292 "HTTP/1.0 200 OK\r\n");
293
294 ensure_contains("delayed/echo content", result,
295 "\r\n"
296 "<llsd><string>agent99</string></llsd>"
297 );
298 }
299
300 /* TO DO:
301 test generation of not found and method not allowed errors
302 */
303}
diff --git a/linden/indra/test/llmime_tut.cpp b/linden/indra/test/llmime_tut.cpp
new file mode 100644
index 0000000..f5cf38f
--- /dev/null
+++ b/linden/indra/test/llmime_tut.cpp
@@ -0,0 +1,443 @@
1/**
2 * @file llmime_tut.cpp
3 * @author Phoenix
4 * @date 2006-12-24
5 * @brief BRIEF_DESC of llmime_tut.cpp
6 *
7 * Copyright (c) 2006-2007, Linden Research, Inc.
8 *
9 * The source code in this file ("Source Code") is provided by Linden Lab
10 * to you under the terms of the GNU General Public License, version 2.0
11 * ("GPL"), unless you have obtained a separate licensing agreement
12 * ("Other License"), formally executed by you and Linden Lab. Terms of
13 * the GPL can be found in doc/GPL-license.txt in this distribution, or
14 * online at http://secondlife.com/developers/opensource/gplv2
15 *
16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlife.com/developers/opensource/flossexception
20 *
21 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above,
23 * and agree to abide by those obligations.
24 *
25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27 * COMPLETENESS OR PERFORMANCE.
28 */
29
30#include <tut/tut.h>
31#include "linden_common.h"
32#include "llmime.h"
33#include "llsdserialize.h"
34
35namespace tut
36{
37 struct mime_index
38 {
39 };
40 typedef test_group<mime_index> mime_index_t;
41 typedef mime_index_t::object mime_index_object_t;
42 tut::mime_index_t tut_mime_index("mime_index");
43
44 template<> template<>
45 void mime_index_object_t::test<1>()
46 {
47 LLMimeIndex mime;
48 ensure("no headers", mime.headers().isUndefined());
49 ensure_equals("invalid offset", mime.offset(), -1);
50 ensure_equals("invalid content length", mime.contentLength(), -1);
51 ensure("no content type", mime.contentType().empty());
52 ensure("not multipart", !mime.isMultipart());
53 ensure_equals("no attachments", mime.subPartCount(), 0);
54 }
55
56 template<> template<>
57 void mime_index_object_t::test<2>()
58 {
59 const S32 CONTENT_LENGTH = 6000;
60 const S32 CONTENT_OFFSET = 100;
61 const std::string CONTENT_TYPE = std::string("image/j2c");
62 LLSD headers;
63 headers["Content-Length"] = CONTENT_LENGTH;
64 headers["Content-Type"] = CONTENT_TYPE;
65 LLMimeIndex mime(headers, CONTENT_OFFSET);
66 ensure("headers are map", mime.headers().isMap());
67 ensure_equals("offset", mime.offset(), CONTENT_OFFSET);
68 ensure_equals("content length", mime.contentLength(), CONTENT_LENGTH);
69 ensure_equals("type is image/j2c", mime.contentType(), CONTENT_TYPE);
70 ensure("not multipart", !mime.isMultipart());
71 ensure_equals("no attachments", mime.subPartCount(), 0);
72 }
73
74 template<> template<>
75 void mime_index_object_t::test<3>()
76 {
77 const S32 MULTI_CONTENT_LENGTH = 8000;
78 const S32 MULTI_CONTENT_OFFSET = 100;
79 const std::string MULTI_CONTENT_TYPE = std::string("multipart/mixed");
80 LLSD headers;
81 headers["Content-Length"] = MULTI_CONTENT_LENGTH;
82 headers["Content-Type"] = MULTI_CONTENT_TYPE;
83 LLMimeIndex mime(headers, MULTI_CONTENT_OFFSET);
84 llinfos << "headers: " << LLSDOStreamer<LLSDNotationFormatter>(headers)
85 << llendl;
86
87
88 const S32 META_CONTENT_LENGTH = 700;
89 const S32 META_CONTENT_OFFSET = 69;
90 const std::string META_CONTENT_TYPE = std::string(
91 "text/llsd+xml");
92 headers = LLSD::emptyMap();
93 headers["Content-Length"] = META_CONTENT_LENGTH;
94 headers["Content-Type"] = META_CONTENT_TYPE;
95 LLMimeIndex meta(headers, META_CONTENT_OFFSET);
96 mime.attachSubPart(meta);
97
98 const S32 IMAGE_CONTENT_LENGTH = 6000;
99 const S32 IMAGE_CONTENT_OFFSET = 200;
100 const std::string IMAGE_CONTENT_TYPE = std::string("image/j2c");
101 headers = LLSD::emptyMap();
102 headers["Content-Length"] = IMAGE_CONTENT_LENGTH;
103 headers["Content-Type"] = IMAGE_CONTENT_TYPE;
104 LLMimeIndex image(headers, IMAGE_CONTENT_OFFSET);
105 mime.attachSubPart(image);
106
107 // make sure we have a valid multi-part
108 ensure("is multipart", mime.isMultipart());
109 ensure_equals("multi offset", mime.offset(), MULTI_CONTENT_OFFSET);
110 ensure_equals(
111 "multi content length",
112 mime.contentLength(),
113 MULTI_CONTENT_LENGTH);
114 ensure_equals("two attachments", mime.subPartCount(), 2);
115
116 // make sure ranged gets do the right thing with out of bounds
117 // sub-parts.
118 LLMimeIndex invalid_child(mime.subPart(-1));
119 ensure("no headers", invalid_child.headers().isUndefined());
120 ensure_equals("invalid offset", invalid_child.offset(), -1);
121 ensure_equals(
122 "invalid content length", invalid_child.contentLength(), -1);
123 ensure("no content type", invalid_child.contentType().empty());
124 ensure("not multipart", !invalid_child.isMultipart());
125 ensure_equals("no attachments", invalid_child.subPartCount(), 0);
126
127 invalid_child = mime.subPart(2);
128 ensure("no headers", invalid_child.headers().isUndefined());
129 ensure_equals("invalid offset", invalid_child.offset(), -1);
130 ensure_equals(
131 "invalid content length", invalid_child.contentLength(), -1);
132 ensure("no content type", invalid_child.contentType().empty());
133 ensure("not multipart", !invalid_child.isMultipart());
134 ensure_equals("no attachments", invalid_child.subPartCount(), 0);
135 }
136
137 template<> template<>
138 void mime_index_object_t::test<4>()
139 {
140 const S32 MULTI_CONTENT_LENGTH = 8000;
141 const S32 MULTI_CONTENT_OFFSET = 100;
142 const std::string MULTI_CONTENT_TYPE = std::string("multipart/mixed");
143 LLSD headers;
144 headers["Content-Length"] = MULTI_CONTENT_LENGTH;
145 headers["Content-Type"] = MULTI_CONTENT_TYPE;
146 LLMimeIndex mime(headers, MULTI_CONTENT_OFFSET);
147
148 const S32 META_CONTENT_LENGTH = 700;
149 const S32 META_CONTENT_OFFSET = 69;
150 const std::string META_CONTENT_TYPE = std::string(
151 "application/llsd+xml");
152 headers = LLSD::emptyMap();
153 headers["Content-Length"] = META_CONTENT_LENGTH;
154 headers["Content-Type"] = META_CONTENT_TYPE;
155 LLMimeIndex meta(headers, META_CONTENT_OFFSET);
156 mime.attachSubPart(meta);
157
158 const S32 IMAGE_CONTENT_LENGTH = 6000;
159 const S32 IMAGE_CONTENT_OFFSET = 200;
160 const std::string IMAGE_CONTENT_TYPE = std::string("image/j2c");
161 headers = LLSD::emptyMap();
162 headers["Content-Length"] = IMAGE_CONTENT_LENGTH;
163 headers["Content-Type"] = IMAGE_CONTENT_TYPE;
164 LLMimeIndex image(headers, IMAGE_CONTENT_OFFSET);
165 mime.attachSubPart(image);
166
167 // check what we have
168 ensure("is multipart", mime.isMultipart());
169 ensure_equals("multi offset", mime.offset(), MULTI_CONTENT_OFFSET);
170 ensure_equals(
171 "multi content length",
172 mime.contentLength(),
173 MULTI_CONTENT_LENGTH);
174 ensure_equals("two attachments", mime.subPartCount(), 2);
175
176 LLMimeIndex actual_meta = mime.subPart(0);
177 ensure_equals(
178 "meta type", actual_meta.contentType(), META_CONTENT_TYPE);
179 ensure_equals(
180 "meta offset", actual_meta.offset(), META_CONTENT_OFFSET);
181 ensure_equals(
182 "meta content length",
183 actual_meta.contentLength(),
184 META_CONTENT_LENGTH);
185
186 LLMimeIndex actual_image = mime.subPart(1);
187 ensure_equals(
188 "image type", actual_image.contentType(), IMAGE_CONTENT_TYPE);
189 ensure_equals(
190 "image offset", actual_image.offset(), IMAGE_CONTENT_OFFSET);
191 ensure_equals(
192 "image content length",
193 actual_image.contentLength(),
194 IMAGE_CONTENT_LENGTH);
195 }
196
197/*
198 template<> template<>
199 void mime_index_object_t::test<5>()
200 {
201 }
202 template<> template<>
203 void mime_index_object_t::test<6>()
204 {
205 }
206 template<> template<>
207 void mime_index_object_t::test<7>()
208 {
209 }
210 template<> template<>
211 void mime_index_object_t::test<8>()
212 {
213 }
214 template<> template<>
215 void mime_index_object_t::test<>()
216 {
217 }
218*/
219}
220
221
222namespace tut
223{
224 struct mime_parse
225 {
226 };
227 typedef test_group<mime_parse> mime_parse_t;
228 typedef mime_parse_t::object mime_parse_object_t;
229 tut::mime_parse_t tut_mime_parse("mime_parse");
230
231 template<> template<>
232 void mime_parse_object_t::test<1>()
233 {
234 // parse one mime object
235 const std::string SERIALIZED_MIME("Content-Length: 200\r\nContent-Type: text/plain\r\n\r\naaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccc\r\n");
236 std::stringstream istr;
237 istr.str(SERIALIZED_MIME);
238 LLMimeIndex mime;
239 LLMimeParser parser;
240 bool ok = parser.parseIndex(istr, mime);
241 ensure("Parse successful.", ok);
242 ensure_equals("content type", mime.contentType(), "text/plain");
243 ensure_equals("content length", mime.contentLength(), 200);
244 ensure_equals("offset", mime.offset(), 49);
245 }
246
247 template<> template<>
248 void mime_parse_object_t::test<2>()
249 {
250 // make sure we only parse one.
251 const std::string SERIALIZED_MIME("Content-Length: 200\r\nContent-Type: text/plain\r\n\r\naaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccc\r\n\r\nContent-Length: 200\r\nContent-Type: text/plain\r\n\r\naaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccc\r\n\r\n");
252 std::stringstream istr;
253 istr.str(SERIALIZED_MIME);
254 LLMimeIndex mime;
255 LLMimeParser parser;
256 bool ok = parser.parseIndex(istr, mime);
257 ensure("Parse successful.", ok);
258 ensure("not multipart.", !mime.isMultipart());
259 ensure_equals("content type", mime.contentType(), "text/plain");
260 ensure_equals("content length", mime.contentLength(), 200);
261 ensure_equals("offset", mime.offset(), 49);
262 }
263
264 template<> template<>
265 void mime_parse_object_t::test<3>()
266 {
267 // test multi-part and lack of content length for some of it.
268 /*
269Content-Type: multipart/mixed; boundary="segment"rnContent-Length: 148rnrn--segmentrnContent-Type: text/plainrnrnsome datarnrn--segmentrnContent-Type: text/xml; charset=UTF-8rnContent-Length: 22rnrn<llsd><undef /></llsd>rnrn
270 */
271 const std::string SERIALIZED_MIME("Content-Type: multipart/mixed; boundary=\"segment\"\r\nContent-Length: 150\r\n\r\n--segment\r\nContent-Type: text/plain\r\n\r\nsome data\r\n\r\n--segment\r\nContent-Type: text/xml; charset=UTF-8\r\nContent-Length: 22\r\n\r\n<llsd><undef /></llsd>\r\n\r\n");
272 std::stringstream istr;
273 istr.str(SERIALIZED_MIME);
274 LLMimeIndex mime;
275 LLMimeParser parser;
276 bool ok = parser.parseIndex(istr, mime);
277 ensure("Parse successful.", ok);
278 ensure("is multipart.", mime.isMultipart());
279 ensure_equals("sub-part count", mime.subPartCount(), 2);
280 ensure_equals("content length", mime.contentLength(), 150);
281 ensure_equals("data offset for multipart", mime.offset(), 74);
282
283 LLMimeIndex mime_plain(mime.subPart(0));
284 ensure_equals(
285 "first part type",
286 mime_plain.contentType(),
287 "text/plain");
288 ensure_equals(
289 "first part content length not known.",
290 mime_plain.contentLength(),
291 -1);
292 ensure_equals("first part offset", mime_plain.offset(), 113);
293
294 LLMimeIndex mime_xml(mime.subPart(1));
295 ensure_equals(
296 "second part type",
297 mime_xml.contentType(),
298 "text/xml; charset=UTF-8");
299 ensure_equals(
300 "second part content length",
301 mime_xml.contentLength(),
302 22);
303 ensure_equals("second part offset", mime_xml.offset(), 198);
304 }
305
306 template<> template<>
307 void mime_parse_object_t::test<4>()
308 {
309 // test multi-part, unquoted separator, and premature eof conditions
310 /*
311Content-Type: multipart/mixed; boundary=segmentrnContent-Length: 220rnrn--segmentrnContent-Type: text/plainrnContent-Length: 55rnrnhow are you today?rnI do not know. I guess I am:n'fine'rnrn--segmentrnContent-Type: text/xml; charset=UTF-8rnContent-Length: 22rnrn<llsd><undef /></llsd>rnrn */
312 const std::string SERIALIZED_MIME("Content-Type: multipart/mixed; boundary=segment\r\nContent-Length: 220\r\n\r\n--segment\r\nContent-Type: text/plain\r\nContent-Length: 55\r\n\r\nhow are you today?\r\nI do not know. I guess I am:\n'fine'\r\n\r\n--segment\r\nContent-Type: text/xml; charset=UTF-8\r\nContent-Length: 22\r\n\r\n<llsd><undef /></llsd>\r\n\r\n");
313 std::stringstream istr;
314 istr.str(SERIALIZED_MIME);
315 LLMimeIndex mime;
316 LLMimeParser parser;
317 bool ok = parser.parseIndex(istr, mime);
318 ensure("Parse successful.", ok);
319 ensure("is multipart.", mime.isMultipart());
320 ensure_equals("sub-part count", mime.subPartCount(), 2);
321 ensure_equals("content length", mime.contentLength(), 220);
322 ensure_equals("data offset for multipart", mime.offset(), 72);
323
324 LLMimeIndex mime_plain(mime.subPart(0));
325 ensure_equals(
326 "first part type",
327 mime_plain.contentType(),
328 "text/plain");
329 ensure_equals(
330 "first part content length",
331 mime_plain.contentLength(),
332 55);
333 ensure_equals("first part offset", mime_plain.offset(), 131);
334
335 LLMimeIndex mime_xml(mime.subPart(1));
336 ensure_equals(
337 "second part type",
338 mime_xml.contentType(),
339 "text/xml; charset=UTF-8");
340 ensure_equals(
341 "second part content length",
342 mime_xml.contentLength(),
343 22);
344 ensure_equals("second part offset", mime_xml.offset(), 262);
345 }
346
347 template<> template<>
348 void mime_parse_object_t::test<5>()
349 {
350 // test multi-part with multiple params
351 const std::string SERIALIZED_MIME("Content-Type: multipart/mixed; boundary=segment; comment=\"testing multiple params.\"\r\nContent-Length: 220\r\n\r\n--segment\r\nContent-Type: text/plain\r\nContent-Length: 55\r\n\r\nhow are you today?\r\nI do not know. I guess I am:\n'fine'\r\n\r\n--segment\r\nContent-Type: text/xml; charset=UTF-8\r\nContent-Length: 22\r\n\r\n<llsd><undef /></llsd>\r\n\r\n");
352 std::stringstream istr;
353 istr.str(SERIALIZED_MIME);
354 LLMimeIndex mime;
355 LLMimeParser parser;
356 bool ok = parser.parseIndex(istr, mime);
357 ensure("Parse successful.", ok);
358 ensure("is multipart.", mime.isMultipart());
359 ensure_equals("sub-part count", mime.subPartCount(), 2);
360 ensure_equals("content length", mime.contentLength(), 220);
361
362 LLMimeIndex mime_plain(mime.subPart(0));
363 ensure_equals(
364 "first part type",
365 mime_plain.contentType(),
366 "text/plain");
367 ensure_equals(
368 "first part content length",
369 mime_plain.contentLength(),
370 55);
371
372 LLMimeIndex mime_xml(mime.subPart(1));
373 ensure_equals(
374 "second part type",
375 mime_xml.contentType(),
376 "text/xml; charset=UTF-8");
377 ensure_equals(
378 "second part content length",
379 mime_xml.contentLength(),
380 22);
381 }
382
383 template<> template<>
384 void mime_parse_object_t::test<6>()
385 {
386 // test multi-part with no specified boundary and eof
387/*
388Content-Type: multipart/relatedrnContent-Length: 220rnrn--rnContent-Type: text/plainrnContent-Length: 55rnrnhow are you today?rnI do not know. I guess I am:n'fine'rnrn--rnContent-Type: text/xml; charset=UTF-8rnContent-Length: 22rnrn<llsd><undef /></llsd>rnrn
389*/
390 const std::string SERIALIZED_MIME("Content-Type: multipart/related\r\nContent-Length: 500\r\n\r\n--\r\nContent-Type: text/plain\r\nContent-Length: 55\r\n\r\nhow are you today?\r\nI do not know. I guess I am:\n'fine'\r\n\r\n--\r\nContent-Type: text/xml; charset=UTF-8\r\nContent-Length: 22\r\n\r\n<llsd><undef /></llsd>\r\n\r\n");
391 std::stringstream istr;
392 istr.str(SERIALIZED_MIME);
393 LLMimeIndex mime;
394 LLMimeParser parser;
395 bool ok = parser.parseIndex(istr, mime);
396 ensure("Parse successful.", ok);
397 ensure("is multipart.", mime.isMultipart());
398 ensure_equals("sub-part count", mime.subPartCount(), 2);
399 ensure_equals("content length", mime.contentLength(), 500);
400 ensure_equals("data offset for multipart", mime.offset(), 56);
401
402 LLMimeIndex mime_plain(mime.subPart(0));
403 ensure_equals(
404 "first part type",
405 mime_plain.contentType(),
406 "text/plain");
407 ensure_equals(
408 "first part content length",
409 mime_plain.contentLength(),
410 55);
411 ensure_equals("first part offset", mime_plain.offset(), 108);
412
413 LLMimeIndex mime_xml(mime.subPart(1));
414 ensure_equals(
415 "second part type",
416 mime_xml.contentType(),
417 "text/xml; charset=UTF-8");
418 ensure_equals(
419 "second part content length",
420 mime_xml.contentLength(),
421 22);
422 ensure_equals("second part offset", mime_xml.offset(), 232);
423 }
424
425/*
426 template<> template<>
427 void mime_parse_object_t::test<>()
428 {
429 }
430 template<> template<>
431 void mime_parse_object_t::test<>()
432 {
433 }
434 template<> template<>
435 void mime_parse_object_t::test<>()
436 {
437 }
438 template<> template<>
439 void mime_parse_object_t::test<>()
440 {
441 }
442*/
443}
diff --git a/linden/indra/test/llpipeutil.cpp b/linden/indra/test/llpipeutil.cpp
new file mode 100644
index 0000000..53c5991
--- /dev/null
+++ b/linden/indra/test/llpipeutil.cpp
@@ -0,0 +1,158 @@
1/**
2 * @file llpipeutil.cpp
3 * @date 2006-05-18
4 * @brief Utility pipe fittings for injecting and extracting strings
5 *
6 * Copyright (c) 2006-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#include "llpipeutil.h"
30
31#include <stdlib.h>
32
33#include "llbufferstream.h"
34#include "llframetimer.h"
35#include "llpumpio.h"
36#include "llrand.h"
37#include "lltimer.h"
38
39F32 pump_loop(LLPumpIO* pump, F32 seconds)
40{
41 LLTimer timer;
42 timer.setTimerExpirySec(seconds);
43 while(!timer.hasExpired())
44 {
45 LLFrameTimer::updateFrameTime();
46 pump->pump();
47 pump->callback();
48 }
49 return timer.getElapsedTimeF32();
50}
51
52//virtual
53LLIOPipe::EStatus LLPipeStringInjector::process_impl(
54 const LLChannelDescriptors& channels,
55 buffer_ptr_t& buffer,
56 bool& eos,
57 LLSD& context,
58 LLPumpIO* pump)
59{
60 buffer->append(channels.out(), (U8*) mString.data(), mString.size());
61 eos = true;
62 return STATUS_DONE;
63}
64
65
66LLIOPipe::EStatus LLPipeStringExtractor::process_impl(
67 const LLChannelDescriptors& channels,
68 buffer_ptr_t& buffer,
69 bool& eos,
70 LLSD& context,
71 LLPumpIO* pump)
72{
73 if(!eos) return STATUS_BREAK;
74 if(!pump || !buffer) return STATUS_PRECONDITION_NOT_MET;
75
76 LLBufferStream istr(channels, buffer.get());
77 std::ostringstream ostr;
78 while (istr.good())
79 {
80 char buf[1024];
81 istr.read(buf, sizeof(buf));
82 ostr.write(buf, istr.gcount());
83 }
84 mString = ostr.str();
85 mDone = true;
86
87 return STATUS_DONE;
88}
89
90
91// virtual
92LLIOPipe::EStatus LLIOFuzz::process_impl(
93 const LLChannelDescriptors& channels,
94 buffer_ptr_t& buffer,
95 bool& eos,
96 LLSD& context,
97 LLPumpIO* pump)
98{
99 while(mByteCount)
100 {
101 std::vector<U8> data;
102 data.reserve(10000);
103 int size = llmin(10000, mByteCount);
104 std::generate_n(
105 std::back_insert_iterator< std::vector<U8> >(data),
106 size,
107 rand);
108 buffer->append(channels.out(), &data[0], size);
109 mByteCount -= size;
110 }
111 return STATUS_OK;
112}
113
114struct random_ascii_generator
115{
116 random_ascii_generator() {}
117 U8 operator()()
118 {
119 int rv = rand();
120 rv %= (127 - 32);
121 rv += 32;
122 return rv;
123 }
124};
125
126// virtual
127LLIOPipe::EStatus LLIOASCIIFuzz::process_impl(
128 const LLChannelDescriptors& channels,
129 buffer_ptr_t& buffer,
130 bool& eos,
131 LLSD& context,
132 LLPumpIO* pump)
133{
134 while(mByteCount)
135 {
136 std::vector<U8> data;
137 data.reserve(10000);
138 int size = llmin(10000, mByteCount);
139 std::generate_n(
140 std::back_insert_iterator< std::vector<U8> >(data),
141 size,
142 random_ascii_generator());
143 buffer->append(channels.out(), &data[0], size);
144 mByteCount -= size;
145 }
146 return STATUS_OK;
147}
148
149// virtual
150LLIOPipe::EStatus LLIONull::process_impl(
151 const LLChannelDescriptors& channels,
152 buffer_ptr_t& buffer,
153 bool& eos,
154 LLSD& context,
155 LLPumpIO* pump)
156{
157 return STATUS_OK;
158}
diff --git a/linden/indra/test/llpipeutil.h b/linden/indra/test/llpipeutil.h
new file mode 100644
index 0000000..7fda905
--- /dev/null
+++ b/linden/indra/test/llpipeutil.h
@@ -0,0 +1,144 @@
1/**
2 * @file llpipeutil.h
3 * @date 2006-05-18
4 * @brief Utility pipe fittings for injecting and extracting strings
5 *
6 * Copyright (c) 2006-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LL_LLPIPEUTIL_H
30#define LL_LLPIPEUTIL_H
31
32#include "lliopipe.h"
33
34
35/**
36 * @brief Simple function which pumps for the specified time.
37 */
38F32 pump_loop(LLPumpIO* pump, F32 seconds);
39
40/**
41 * @brief Simple class which writes a string and then marks the stream
42 * as done.
43 */
44class LLPipeStringInjector : public LLIOPipe
45{
46public:
47 LLPipeStringInjector(const std::string& string)
48 : mString(string)
49 { }
50
51protected:
52 virtual EStatus process_impl(
53 const LLChannelDescriptors& channels,
54 buffer_ptr_t& buffer,
55 bool& eos,
56 LLSD& context,
57 LLPumpIO* pump);
58
59private:
60 std::string mString;
61};
62
63
64class LLPipeStringExtractor : public LLIOPipe
65{
66public:
67 LLPipeStringExtractor() : mDone(false) { }
68
69 bool done() { return mDone; }
70 std::string string() { return mString; }
71
72protected:
73 // LLIOPipe API implementation.
74 virtual EStatus process_impl(
75 const LLChannelDescriptors& channels,
76 LLIOPipe::buffer_ptr_t& buffer,
77 bool& eos,
78 LLSD& context,
79 LLPumpIO* pump);
80
81private:
82 bool mDone;
83 std::string mString;
84};
85
86/**
87 * @brief Generate a specified number of bytes of random data
88 */
89class LLIOFuzz : public LLIOPipe
90{
91public:
92 LLIOFuzz(int byte_count) : mByteCount(byte_count) {}
93
94protected:
95 virtual EStatus process_impl(
96 const LLChannelDescriptors& channels,
97 buffer_ptr_t& buffer,
98 bool& eos,
99 LLSD& context,
100 LLPumpIO* pump);
101
102private:
103 int mByteCount;
104};
105
106/**
107 * @brief Generate some ascii fuz
108 */
109class LLIOASCIIFuzz : public LLIOPipe
110{
111public:
112 LLIOASCIIFuzz(int byte_count) : mByteCount(byte_count) {}
113
114protected:
115 virtual EStatus process_impl(
116 const LLChannelDescriptors& channels,
117 buffer_ptr_t& buffer,
118 bool& eos,
119 LLSD& context,
120 LLPumpIO* pump);
121
122private:
123 int mByteCount;
124};
125
126
127/**
128 * @brief Pipe that does nothing except return STATUS_OK
129 */
130class LLIONull : public LLIOPipe
131{
132public:
133 LLIONull() {}
134
135protected:
136 virtual EStatus process_impl(
137 const LLChannelDescriptors& channels,
138 buffer_ptr_t& buffer,
139 bool& eos,
140 LLSD& context,
141 LLPumpIO* pump);
142};
143
144#endif // LL_LLPIPEUTIL_H
diff --git a/linden/indra/test/llsd_message_system_tut.cpp b/linden/indra/test/llsd_message_system_tut.cpp
new file mode 100644
index 0000000..b46701c
--- /dev/null
+++ b/linden/indra/test/llsd_message_system_tut.cpp
@@ -0,0 +1,142 @@
1/**
2 * @file llsd_message_system_tut.cpp
3 * @brief Testing the LLSDMessageSystem.
4 *
5 * Copyright (c) 2006-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28/**
29 *
30 * These classes test the LLSDMessageSystem.
31 *
32 */
33
34#include <tut/tut.h>
35#include "llsdmessagesystem.h"
36#include "llsdutil.h"
37
38namespace tut
39{
40 class LLSDMessageSystemTestData
41 {
42 public:
43 LLSDMessageSystemTestData() {;}
44 ~LLSDMessageSystemTestData() {;}
45
46 LLSDMessageSystem mMsgSystem;
47 };
48
49 typedef test_group<LLSDMessageSystemTestData> LLSDMessageSystemTestGroup;
50 typedef LLSDMessageSystemTestGroup::object LLSDMessageSystemTestObject;
51 LLSDMessageSystemTestGroup llsdMessageSystemTestGroup("llsd_message_system");
52
53 template<> template<>
54 void LLSDMessageSystemTestObject::test<1>()
55 {
56 LLSD input;
57 U32 valueIn, valueOut;
58 valueIn = 42;
59 input["Block"]["Var"] = ll_sd_from_U32(valueIn);
60 mMsgSystem.setInput(input);
61 mMsgSystem.getU32Fast("Block", "Var", valueOut);
62 ensure_equals("U32 from message system matches input U32", valueIn, valueOut);
63 }
64
65 template<> template<>
66 void LLSDMessageSystemTestObject::test<2>()
67 {
68 LLSD input;
69 LLUUID valueIn, valueOut;
70 valueIn.generate();
71 input["Block"]["Var"] = valueIn;
72 mMsgSystem.setInput(input);
73 mMsgSystem.getUUIDFast("Block", "Var", valueOut);
74 ensure_equals("UUID from message system matches input UUID", valueIn, valueOut);
75 }
76
77 template<> template<>
78 void LLSDMessageSystemTestObject::test<3>()
79 {
80 LLSD input;
81 U32 valueIn, valueOut;
82 LLHost host("127.0.0.1:80");
83 valueIn = host.getAddress();
84 input["Block"]["Var"] = ll_sd_from_U32(valueIn);
85 mMsgSystem.setInput(input);
86 mMsgSystem.getIPAddrFast("Block", "Var", valueOut);
87 ensure_equals("IP from message system matches input IP", valueIn, valueOut);
88 }
89
90 template<> template<>
91 void LLSDMessageSystemTestObject::test<4>()
92 {
93 LLSD input;
94 U16 valueIn, valueOut;
95 LLHost host("127.0.0.1:80");
96 valueIn = host.getPort();
97 input["Block"]["Var"] = (S32)valueIn;
98 mMsgSystem.setInput(input);
99 mMsgSystem.getIPPortFast("Block", "Var", valueOut);
100 ensure_equals("Port from message system matches input port", valueIn, valueOut);
101 }
102
103 template<> template<>
104 void LLSDMessageSystemTestObject::test<5>()
105 {
106 LLSD input;
107 U64 valueIn, valueOut;
108 valueIn = 42;
109 input["Block"]["Var"] = ll_sd_from_U64(valueIn);
110 mMsgSystem.setInput(input);
111 mMsgSystem.getU64Fast("Block", "Var", valueOut);
112 ensure_equals("Port from message system matches input port", valueIn, valueOut);
113 }
114
115 template<> template<>
116 void LLSDMessageSystemTestObject::test<6>()
117 {
118 LLSD input;
119 std::string valueIn = "Value";
120 input["Block"]["Var"] = valueIn;
121 mMsgSystem.setInput(input);
122 const U32 buffLen = 16;
123 char buff[buffLen];
124 mMsgSystem.getStringFast("Block", "Var", buffLen, buff);
125 ensure_equals("string read from message system matches llsd input", std::string(buff), valueIn);
126 }
127
128 template<> template<>
129 void LLSDMessageSystemTestObject::test<7>()
130 {
131 LLSD input;
132 U32 valueIn, valueOut;
133 valueIn = 42;
134 input["Block"][0]["Var"] = ll_sd_from_U32(valueIn);
135 input["Block"][1]["Var"] = ll_sd_from_U32(valueIn + 1);
136 mMsgSystem.setInput(input);
137 mMsgSystem.getU32Fast("Block", "Var", valueOut, 0);
138 ensure_equals("U32 from message system matches input U32", valueIn, valueOut);
139 mMsgSystem.getU32Fast("Block", "Var", valueOut, 1);
140 ensure_equals("U32 from message system matches input U32", (valueIn + 1), valueOut);
141 }
142}
diff --git a/linden/indra/test/llsd_new_tut.cpp b/linden/indra/test/llsd_new_tut.cpp
new file mode 100644
index 0000000..e33a28a
--- /dev/null
+++ b/linden/indra/test/llsd_new_tut.cpp
@@ -0,0 +1,840 @@
1/**
2 * @file llsd_new_tut.cpp
3 * @date February 2006
4 * @brief LLSD unit tests
5 *
6 * Copyright (c) 2006-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#include <math.h>
30#include <tut/tut.h>
31#include "lltut.h"
32
33#include "llsd.h"
34
35namespace tut
36{
37 template<class T>
38 class SDTraits
39 {
40 protected:
41 typedef T (LLSD::*Getter)() const;
42
43 LLSD::Type type;
44 Getter getter;
45
46 public:
47 SDTraits();
48
49 T get(const LLSD& actual)
50 {
51 return (actual.*getter)();
52 }
53
54 bool checkType(const LLSD& actual)
55 {
56 return actual.type() == type;
57 }
58 };
59
60 template<>
61 SDTraits<LLSD::Boolean>::SDTraits()
62 : type(LLSD::TypeBoolean), getter(&LLSD::asBoolean)
63 { }
64
65 template<>
66 SDTraits<LLSD::Integer>::SDTraits()
67 : type(LLSD::TypeInteger), getter(&LLSD::asInteger)
68 { }
69
70 template<>
71 SDTraits<LLSD::Real>::SDTraits()
72 : type(LLSD::TypeReal), getter(&LLSD::asReal)
73 { }
74
75 template<>
76 SDTraits<LLSD::UUID>::SDTraits()
77 : type(LLSD::TypeUUID), getter(&LLSD::asUUID)
78 { }
79
80 template<>
81 SDTraits<LLSD::String>::SDTraits()
82 : type(LLSD::TypeString), getter(&LLSD::asString)
83 { }
84
85 template<>
86 class SDTraits<LLString> : public SDTraits<LLSD::String>
87 { };
88
89 template<>
90 class SDTraits<const char*> : public SDTraits<LLSD::String>
91 { };
92
93 template<>
94 SDTraits<LLSD::Date>::SDTraits()
95 : type(LLSD::TypeDate), getter(&LLSD::asDate)
96 { }
97
98 template<>
99 SDTraits<LLSD::URI>::SDTraits()
100 : type(LLSD::TypeURI), getter(&LLSD::asURI)
101 { }
102
103 template<>
104 SDTraits<LLSD::Binary>::SDTraits()
105 : type(LLSD::TypeBinary), getter(&LLSD::asBinary)
106 { }
107
108 class SDCleanupCheck
109 {
110 private:
111 U32 mOutstandingAtStart;
112 public:
113 SDCleanupCheck() : mOutstandingAtStart(LLSD::outstandingCount()) { }
114 ~SDCleanupCheck()
115 {
116 ensure_equals("SDCleanupCheck",
117 LLSD::outstandingCount(), mOutstandingAtStart);
118 }
119 };
120
121 class SDAllocationCheck : public SDCleanupCheck
122 {
123 private:
124 std::string mMessage;
125 U32 mExpectedAllocations;
126 U32 mAllocationAtStart;
127 public:
128 SDAllocationCheck(const std::string& message, int expectedAllocations)
129 : mMessage(message),
130 mExpectedAllocations(expectedAllocations),
131 mAllocationAtStart(LLSD::allocationCount())
132 { }
133 ~SDAllocationCheck()
134 {
135 ensure_equals(mMessage + " SDAllocationCheck",
136 LLSD::allocationCount() - mAllocationAtStart,
137 mExpectedAllocations);
138 }
139 };
140
141 struct SDTestData {
142 template<class T>
143 static void ensureTypeAndValue(const char* msg, const LLSD& actual,
144 T expectedValue)
145 {
146 SDTraits<T> traits;
147
148 std::string s(msg);
149
150 ensure( s + " type", traits.checkType(actual));
151 ensure_equals( s + " value", traits.get(actual), expectedValue);
152 }
153 };
154
155 typedef test_group<SDTestData> SDTestGroup;
156 typedef SDTestGroup::object SDTestObject;
157
158 SDTestGroup sdTestGroup("LLSD(new)");
159
160 template<> template<>
161 void SDTestObject::test<1>()
162 // construction and test of undefined
163 {
164 SDCleanupCheck check;
165
166 LLSD u;
167 ensure("is undefined", u.isUndefined());
168 }
169
170 template<> template<>
171 void SDTestObject::test<2>()
172 // setting and fetching scalar types
173 {
174 SDCleanupCheck check;
175
176 LLSD v;
177
178 v = true; ensureTypeAndValue("set true", v, true);
179 v = false; ensureTypeAndValue("set false", v, false);
180 v = true; ensureTypeAndValue("set true again", v, true);
181
182 v = 42; ensureTypeAndValue("set to 42", v, 42);
183 v = 0; ensureTypeAndValue("set to zero", v, 0);
184 v = -12345; ensureTypeAndValue("set to neg", v, -12345);
185 v = 2000000000; ensureTypeAndValue("set to big", v, 2000000000);
186
187 v = 3.14159265359;
188 ensureTypeAndValue("set to pi", v, 3.14159265359);
189 ensure_not_equals("isn't float", v.asReal(),
190 (float)3.14159265359);
191 v = 6.7e256; ensureTypeAndValue("set to big", v, 6.7e256);
192
193 LLUUID nullUUID;
194 LLUUID newUUID;
195 newUUID.generate();
196
197 v = nullUUID; ensureTypeAndValue("set to null UUID", v, nullUUID);
198 v = newUUID; ensureTypeAndValue("set to new UUID", v, newUUID);
199 v = nullUUID; ensureTypeAndValue("set to null again", v, nullUUID);
200
201 // strings must be tested with three (!) types of string objects
202 std::string s = "now is the time";
203 LLString ls = "for all good zorks";
204 const char* cs = "to come to the air of their planet";
205
206 v = s; ensureTypeAndValue("set to std::string", v, s);
207 v = ls; ensureTypeAndValue("set to LLString", v, ls);
208 v = cs; ensureTypeAndValue("set to const char*", v, cs);
209
210 LLDate epoch;
211 LLDate aDay("2001-10-22T10:11:12.00Z");
212
213 v = epoch; ensureTypeAndValue("set to epoch", v, epoch);
214 v = aDay; ensureTypeAndValue("set to a day", v, aDay);
215
216 LLURI path("http://slurl.com/secondlife/Ambleside/57/104/26/");
217
218 v = path; ensureTypeAndValue("set to a uri", v, path);
219
220 const char source[] = "once in a blue moon";
221 std::vector<U8> data;
222 copy(&source[0], &source[sizeof(source)], back_inserter(data));
223
224 v = data; ensureTypeAndValue("set to data", v, data);
225
226 v.clear();
227 ensure("reset to undefined", v.type() == LLSD::TypeUndefined);
228 }
229
230 template<> template<>
231 void SDTestObject::test<3>()
232 // construction via scalar values
233 // tests both constructor and initialize forms
234 {
235 SDCleanupCheck check;
236
237 LLSD b1(true); ensureTypeAndValue("construct boolean", b1, true);
238 LLSD b2 = true; ensureTypeAndValue("initialize boolean", b2, true);
239 LLSD i1(42); ensureTypeAndValue("construct int", i1, 42);
240 LLSD i2 =42; ensureTypeAndValue("initialize int", i2, 42);
241 LLSD d1(1.2); ensureTypeAndValue("construct double", d1, 1.2);
242 LLSD d2 = 1.2; ensureTypeAndValue("initialize double", d2, 1.2);
243
244 LLUUID newUUID;
245 newUUID.generate();
246 LLSD u1(newUUID);
247 ensureTypeAndValue("construct UUID", u1, newUUID);
248 LLSD u2 = newUUID;
249 ensureTypeAndValue("initialize UUID", u2, newUUID);
250
251 LLSD ss1(std::string("abc"));
252 ensureTypeAndValue("construct std::string", ss1, "abc");
253 LLSD ss2 = std::string("abc");
254 ensureTypeAndValue("initialize std::string",ss2, "abc");
255 LLSD sl1(LLString("def"));
256 ensureTypeAndValue("construct LLString", sl1, "def");
257 LLSD sl2 = LLString("def");
258 ensureTypeAndValue("initialize LLString", sl2, "def");
259 LLSD sc1("ghi");
260 ensureTypeAndValue("construct const char*", sc1, "ghi");
261 LLSD sc2 = "ghi";
262 ensureTypeAndValue("initialize const char*",sc2, "ghi");
263
264 LLDate aDay("2001-10-22T10:11:12.00Z");
265 LLSD t1(aDay); ensureTypeAndValue("construct LLDate", t1, aDay);
266 LLSD t2 = aDay; ensureTypeAndValue("initialize LLDate", t2, aDay);
267
268 LLURI path("http://slurl.com/secondlife/Ambleside/57/104/26/");
269 LLSD p1(path); ensureTypeAndValue("construct LLURI", p1, path);
270 LLSD p2 = path; ensureTypeAndValue("initialize LLURI", p2, path);
271
272 const char source[] = "once in a blue moon";
273 std::vector<U8> data;
274 copy(&source[0], &source[sizeof(source)], back_inserter(data));
275 LLSD x1(data); ensureTypeAndValue("construct vector<U8>", x1, data);
276 LLSD x2 = data; ensureTypeAndValue("initialize vector<U8>", x2, data);
277 }
278
279 void checkConversions(const char* msg, const LLSD& v,
280 LLSD::Boolean eBoolean, LLSD::Integer eInteger,
281 LLSD::Real eReal, const LLSD::String& eString)
282 {
283 std::string s(msg);
284
285 ensure_equals(s+" to bool", v.asBoolean(), eBoolean);
286 ensure_equals(s+" to int", v.asInteger(), eInteger);
287 if (eReal == eReal)
288 {
289 ensure_equals(s+" to real", v.asReal(), eReal);
290 ensure_equals(s+" to string", v.asString(), eString);
291 }
292 else
293 {
294// TODO: Fix on windows....
295#ifndef LL_WINDOWS
296# if !defined(fpclassify) && __GNUC__ >= 3
297# define FPCLASSIFY_NAMESPACE std::
298# else
299# define FPCLASSIFY_NAMESPACE
300# endif
301 int left = FPCLASSIFY_NAMESPACE fpclassify(v.asReal());
302 int right = FPCLASSIFY_NAMESPACE fpclassify(eReal);
303
304 ensure_equals(s+" to real", left, right);
305 ensure_equals(s+" to string", v.asString(), eString);
306#endif
307 }
308 }
309
310 template<> template<>
311 void SDTestObject::test<4>()
312 // conversion between undefined and basic scalar types:
313 // boolean, integer, real and string
314 {
315 SDCleanupCheck check;
316
317 LLSD v; checkConversions("untitled", v, false, 0, 0.0, "");
318
319 v = false; checkConversions("false", v, false, 0, 0.0, "");
320 v = true; checkConversions("true", v, true, 1, 1.0, "true");
321
322 v = 0; checkConversions("zero", v, false, 0, 0.0, "0");
323 v = 1; checkConversions("one", v, true, 1, 1.0, "1");
324 v = -33; checkConversions("neg33", v, true, -33, -33.0, "-33");
325
326 v = 0.0; checkConversions("0.0", v, false, 0, 0.0, "0");
327 v = 0.5; checkConversions("point5", v, true, 0, 0.5, "0.5");
328 v = 0.9; checkConversions("point9", v, true, 0, 0.9, "0.9");
329 v = -3.9; checkConversions("neg3dot9", v, true, -3, -3.9, "-3.9");
330 v = sqrt(-1.0); checkConversions("NaN", v, false, 0, sqrt(-1.0), "nan");
331
332 v = ""; checkConversions("empty", v, false, 0, 0.0, "");
333 v = "0"; checkConversions("digit0", v, true, 0, 0.0, "0");
334 v = "10"; checkConversions("digit10", v, true, 10, 10.0, "10");
335 v = "-2.345"; checkConversions("decdigits", v,
336 true, -2, -2.345, "-2.345");
337 v = "apple"; checkConversions("apple", v, true, 0, 0.0, "apple");
338 v = "33bob"; checkConversions("digialpha", v, true, 0, 0.0, "33bob");
339 v = " "; checkConversions("space", v, true, 0, 0.0, " ");
340 v = "\n"; checkConversions("newline", v, true, 0, 0.0, "\n");
341 }
342
343 template<class T>
344 void checkRoundTrip(const std::string& msg, const LLSD& actual,
345 const char* sExpected, T vExpected)
346 {
347 std::string str = actual.asString();
348
349 if (sExpected) {
350 ensure_equals(msg + " string", str, sExpected);
351 }
352
353 LLSD u(str);
354 SDTraits<T> traits;
355
356 ensure_equals(msg + " value", traits.get(u), vExpected);
357 }
358
359
360 template<> template<>
361 void SDTestObject::test<5>()
362 // conversion of String to and from UUID, Date and URI.
363 {
364 SDCleanupCheck check;
365
366 LLSD v;
367
368 LLUUID nullUUID;
369 LLUUID someUUID;
370 someUUID.generate();
371
372 v = nullUUID; checkRoundTrip("null uuid", v,
373 "00000000-0000-0000-0000-000000000000", nullUUID);
374 v = someUUID; checkRoundTrip("random uuid", v, 0, someUUID);
375
376 LLDate epoch;
377 LLDate beta("2003-04-30T04:00:00Z");
378 LLDate oneOh("2003-06-23T04:00:00Z");
379
380 v = epoch; checkRoundTrip("epoch date", v, 0, epoch);
381 v = beta; checkRoundTrip("beta date", v,
382 "2003-04-30T04:00:00Z", beta);
383 v = oneOh; checkRoundTrip("1.0 date", v,
384 "2003-06-23T04:00:00Z", oneOh);
385
386 LLURI empty;
387 LLURI path("http://slurl.com/secondlife/Ambleside/57/104/26/");
388 LLURI mail("mailto:zero.linden@secondlife.com");
389
390 v = empty; checkRoundTrip("empty URI", v, 0, empty);
391 v = path; checkRoundTrip("path URI", v,
392 "http://slurl.com/secondlife/Ambleside/57/104/26/",
393 path);
394 v = mail; checkRoundTrip("mail URI", v,
395 "mailto:zero.linden@secondlife.com", mail);
396 }
397
398 template<> template<>
399 void SDTestObject::test<6>()
400 // copy construction and assignment
401 // checking for shared values after constr. or assignment
402 // checking in both the same type and change of type case
403 {
404 SDCleanupCheck check;
405
406 {
407 LLSD v = 42;
408
409 LLSD w0(v);
410 ensureTypeAndValue("int constr.", w0, 42);
411
412 LLSD w1(v);
413 w1 = 13;
414 ensureTypeAndValue("int constr. change case 1", w1, 13);
415 ensureTypeAndValue("int constr. change case 2", v, 42);
416
417 LLSD w2(v);
418 v = 7;
419 ensureTypeAndValue("int constr. change case 3", w2, 42);
420 ensureTypeAndValue("int constr. change case 4", v, 7);
421 }
422
423 {
424 LLSD v = 42;
425
426 LLSD w1(v);
427 w1 = "bob";
428 ensureTypeAndValue("string constr. change case 1", w1, "bob");
429 ensureTypeAndValue("string constr. change case 2", v, 42);
430
431 LLSD w2(v);
432 v = "amy";
433 ensureTypeAndValue("string constr. change case 3", w2, 42);
434 ensureTypeAndValue("string constr. change case 4", v, "amy");
435 }
436
437 {
438 LLSD v = 42;
439
440 LLSD w0;
441 w0 = v;
442 ensureTypeAndValue("int assign", w0, 42);
443
444 LLSD w1;
445 w1 = v;
446 w1 = 13;
447 ensureTypeAndValue("int assign change case 1", w1, 13);
448 ensureTypeAndValue("int assign change case 2", v, 42);
449
450 LLSD w2;
451 w2 = v;
452 v = 7;
453 ensureTypeAndValue("int assign change case 3", w2, 42);
454 ensureTypeAndValue("int assign change case 4", v, 7);
455 }
456
457 {
458 LLSD v = 42;
459
460 LLSD w1;
461 w1 = v;
462 w1 = "bob";
463 ensureTypeAndValue("string assign change case 1", w1, "bob");
464 ensureTypeAndValue("string assign change case 2", v, 42);
465
466 LLSD w2;
467 w2 = v;
468 v = "amy";
469 ensureTypeAndValue("string assign change case 3", w2, 42);
470 ensureTypeAndValue("string assign change case 4", v, "amy");
471 }
472 }
473
474
475 template<> template<>
476 void SDTestObject::test<7>()
477 // Test assignment and casting to various scalar types. These
478 // assignments should invoke the right conversion without it being
479 // mentioned explicitly. The few exceptions are marked SAD.
480 {
481 SDCleanupCheck check;
482
483 LLSD v(" 42.375");
484
485 bool b = false;
486 b = v; ensure_equals("assign to bool", b, true);
487 b = (bool)v; ensure_equals("cast to bool", b, true);
488
489 int i = 99;
490 i = v; ensure_equals("assign to int", i, 42);
491 i = (int)v; ensure_equals("cast to int", i, 42);
492
493 double d = 3.14159;
494 d = v; ensure_equals("assign to double", d, 42.375);
495 d = (double)v; ensure_equals("cast to double", d, 42.375);
496
497 std::string s = "yo";
498// SAD s = v; ensure_equals("assign to string", s, " 42.375");
499 s = (std::string)v; ensure_equals("cast to string", s, " 42.375");
500
501 LLString t = "yo";
502// SAD t = v; ensure_equals("assign to LLString", t, " 42.375");
503 t = (LLString)v; ensure_equals("cast to LLString", t, " 42.375");
504
505 std::string uuidStr = "b1e50c2b-b627-4d23-8a86-a65d97b6319b";
506 v = uuidStr;
507 LLUUID u;
508 u = v;
509 ensure_equals("assign to LLUUID", u, LLUUID(uuidStr));
510// SAD u = (LLUUID)v;
511// ensure_equals("cast to LLUUID", u, LLUUID(uuidStr));
512
513 std::string dateStr = "2005-10-24T15:00:00Z";
514 v = dateStr;
515 LLDate date;
516 date = v;
517 ensure_equals("assign to LLDate", date.asString(), dateStr);
518// SAD date = (LLDate)v;
519// ensure_equals("cast to LLDate", date.asString(), dateStr);
520
521 std::string uriStr = "http://secondlife.com";
522 v = uriStr;
523 LLURI uri;
524 uri = v;
525 ensure_equals("assign to LLURI", uri.asString(), uriStr);
526// SAD uri = (LLURI)v;
527// ensure_equals("cast to LLURI", uri.asString(), uriStr);
528 }
529
530 template<> template<>
531 void SDTestObject::test<8>()
532 // Test construction of various scalar types from LLSD.
533 // Test both construction and initialization forms.
534 // These should invoke the right conversion without it being
535 // mentioned explicitly. The few exceptions are marked SAD.
536 {
537 SDCleanupCheck check;
538
539 LLSD v(" 42.375");
540
541 bool b1(v); ensure_equals("contruct bool", b1, true);
542 bool b2 = v; ensure_equals("initialize bool", b2, true);
543
544 int i1(v); ensure_equals("contruct int", i1, 42);
545 int i2 = v; ensure_equals("initialize int", i2, 42);
546
547 double d1(v); ensure_equals("contruct double", d1, 42.375);
548 double d2 = v; ensure_equals("initialize double", d2, 42.375);
549
550 std::string s1(v);
551 std::string s2 = v;
552 ensure_equals("contruct string", s1, " 42.375");
553 ensure_equals("initialize string", s2, " 42.375");
554
555 LLString t1(v);
556 LLString t2 = v.asString(); // SAD
557 ensure_equals("contruct LLString", t1, " 42.375");
558 ensure_equals("initialize LLString", t2, " 42.375");
559
560 std::string uuidStr = "b1e50c2b-b627-4d23-8a86-a65d97b6319b";
561 v = uuidStr;
562 LLUUID uuid1(v.asUUID()); // SAD
563 LLUUID uuid2 = v;
564 ensure_equals("contruct LLUUID", uuid1, LLUUID(uuidStr));
565 ensure_equals("initialize LLUUID", uuid2, LLUUID(uuidStr));
566
567 std::string dateStr = "2005-10-24T15:00:00Z";
568 v = dateStr;
569 LLDate date1(v.asDate()); // SAD
570 LLDate date2 = v;
571 ensure_equals("contruct LLDate", date1.asString(), dateStr);
572 ensure_equals("initialize LLDate", date2.asString(), dateStr);
573
574 std::string uriStr = "http://secondlife.com";
575 v = uriStr;
576 LLURI uri1(v.asURI()); // SAD
577 LLURI uri2 = v;
578 ensure_equals("contruct LLURI", uri1.asString(), uriStr);
579 ensure_equals("initialize LLURI", uri2.asString(), uriStr);
580 }
581
582
583 template<> template<>
584 void SDTestObject::test<9>()
585 // test to make sure v is interpreted as a bool in a various
586 // scenarios.
587 {
588 SDCleanupCheck check;
589
590 LLSD v = "0";
591 // magic value that is interpreted as boolean true, but integer false!
592
593 ensure_equals("trinary operator bool", (v ? true : false), true);
594 ensure_equals("convert to int, then bool",
595 ((int)v ? true : false), false);
596
597 if(v)
598 {
599 ensure("if converted to bool", true);
600 }
601 else
602 {
603 fail("bool did not convert to a bool in if statement.");
604 }
605
606 if(!v)
607 {
608 fail("bool did not convert to a bool in negated if statement.");
609 }
610 }
611
612 template<> template<>
613 void SDTestObject::test<10>()
614 // map operations
615 {
616 SDCleanupCheck check;
617
618 LLSD v;
619 ensure("undefined has no members", !v.has("amy"));
620 ensure("undefined get() is undefined", v.get("bob").isUndefined());
621
622 v = LLSD::emptyMap();
623 ensure("empty map is a map", v.isMap());
624 ensure("empty map has no members", !v.has("cam"));
625 ensure("empty map get() is undefined", v.get("don").isUndefined());
626
627 v.clear();
628 v.insert("eli", 43);
629 ensure("insert converts to map", v.isMap());
630 ensure("inserted key is present", v.has("eli"));
631 ensureTypeAndValue("inserted value", v.get("eli"), 43);
632
633 v.insert("fra", false);
634 ensure("first key still present", v.has("eli"));
635 ensure("second key is present", v.has("fra"));
636 ensureTypeAndValue("first value", v.get("eli"), 43);
637 ensureTypeAndValue("second value", v.get("fra"), false);
638
639 v.erase("eli");
640 ensure("first key now gone", !v.has("eli"));
641 ensure("second key still present", v.has("fra"));
642 ensure("first value gone", v.get("eli").isUndefined());
643 ensureTypeAndValue("second value sill there", v.get("fra"), false);
644
645 v.erase("fra");
646 ensure("second key now gone", !v.has("fra"));
647 ensure("second value gone", v.get("fra").isUndefined());
648
649 v["gil"] = (std::string)"good morning";
650 ensure("third key present", v.has("gil"));
651 ensureTypeAndValue("third key value", v.get("gil"), "good morning");
652
653 const LLSD& cv = v; // FIX ME IF POSSIBLE
654 ensure("missing key", cv["ham"].isUndefined());
655 ensure("key not present", !v.has("ham"));
656
657 LLSD w = 43;
658 const LLSD& cw = w; // FIX ME IF POSSIBLE
659 int i = cw["ian"];
660 ensureTypeAndValue("other missing value", i, 0);
661 ensure("other missing key", !w.has("ian"));
662 ensure("no conversion", w.isInteger());
663
664 LLSD x;
665 x = v;
666 ensure("copy map type", x.isMap());
667 ensureTypeAndValue("copy map value gil", x.get("gil"), "good morning");
668 }
669
670
671 template<> template<>
672 void SDTestObject::test<11>()
673 // array operations
674 {
675 SDCleanupCheck check;
676
677 LLSD v;
678 ensure_equals("undefined has no size", v.size(), 0);
679 ensure("undefined get() is undefined", v.get(0).isUndefined());
680
681 v = LLSD::emptyArray();
682 ensure("empty array is an array", v.isArray());
683 ensure_equals("empty array has no size", v.size(), 0);
684 ensure("empty map get() is undefined", v.get(0).isUndefined());
685
686 v.clear();
687 v.append(88);
688 v.append("noodle");
689 v.append(true);
690 ensure_equals("appened array size", v.size(), 3);
691 ensure("append array is an array", v.isArray());
692 ensureTypeAndValue("append 0", v[0], 88);
693 ensureTypeAndValue("append 1", v[1], "noodle");
694 ensureTypeAndValue("append 2", v[2], true);
695
696 v.insert(0, 77);
697 v.insert(2, "soba");
698 v.insert(4, false);
699 ensure_equals("inserted array size", v.size(), 6);
700 ensureTypeAndValue("post insert 0", v[0], 77);
701 ensureTypeAndValue("post insert 1", v[1], 88);
702 ensureTypeAndValue("post insert 2", v[2], "soba");
703 ensureTypeAndValue("post insert 3", v[3], "noodle");
704 ensureTypeAndValue("post insert 4", v[4], false);
705 ensureTypeAndValue("post insert 5", v[5], true);
706
707 ensureTypeAndValue("get 1", v.get(1), 88);
708 v.set(1, "hot");
709 ensureTypeAndValue("set 1", v.get(1), "hot");
710
711 v.erase(3);
712 ensure_equals("post erase array size", v.size(), 5);
713 ensureTypeAndValue("post erase 0", v[0], 77);
714 ensureTypeAndValue("post erase 1", v[1], "hot");
715 ensureTypeAndValue("post erase 2", v[2], "soba");
716 ensureTypeAndValue("post erase 3", v[3], false);
717 ensureTypeAndValue("post erase 4", v[4], true);
718
719 v.append(34);
720 ensure_equals("size after append", v.size(), 6);
721 ensureTypeAndValue("post append 5", v[5], 34);
722
723 LLSD w;
724 w = v;
725 ensure("copy array type", w.isArray());
726 ensure_equals("copy array size", w.size(), 6);
727 ensureTypeAndValue("copy array 0", w[0], 77);
728 ensureTypeAndValue("copy array 1", w[1], "hot");
729 ensureTypeAndValue("copy array 2", w[2], "soba");
730 ensureTypeAndValue("copy array 3", w[3], false);
731 ensureTypeAndValue("copy array 4", w[4], true);
732 ensureTypeAndValue("copy array 5", w[5], 34);
733 }
734
735
736 template<> template<>
737 void SDTestObject::test<12>()
738 // no sharing
739 {
740 SDCleanupCheck check;
741
742 LLSD a = 99;
743 LLSD b = a;
744 a = 34;
745 ensureTypeAndValue("top level original changed", a, 34);
746 ensureTypeAndValue("top level copy unaltered", b, 99);
747 b = a;
748 b = 66;
749 ensureTypeAndValue("top level original unaltered", a, 34);
750 ensureTypeAndValue("top level copy changed", b, 66);
751
752 a[0] = "uno";
753 a[1] = 99;
754 a[2] = 1.414;
755 b = a;
756 a[1] = 34;
757 ensureTypeAndValue("array member original changed", a[1], 34);
758 ensureTypeAndValue("array member copy unaltered", b[1], 99);
759 b = a;
760 b[1] = 66;
761 ensureTypeAndValue("array member original unaltered", a[1], 34);
762 ensureTypeAndValue("array member copy changed", b[1], 66);
763
764 a["alpha"] = "uno";
765 a["beta"] = 99;
766 a["gamma"] = 1.414;
767 b = a;
768 a["beta"] = 34;
769 ensureTypeAndValue("map member original changed", a["beta"], 34);
770 ensureTypeAndValue("map member copy unaltered", b["beta"], 99);
771 b = a;
772 b["beta"] = 66;
773 ensureTypeAndValue("map member original unaltered", a["beta"], 34);
774 ensureTypeAndValue("map member copy changed", b["beta"], 66);
775 }
776
777 template<> template<>
778 void SDTestObject::test<13>()
779 // sharing implementation
780 {
781 SDCleanupCheck check;
782
783 {
784 SDAllocationCheck check("copy construct undefinded", 0);
785 LLSD v;
786 LLSD w = v;
787 }
788
789 {
790 SDAllocationCheck check("assign undefined", 0);
791 LLSD v;
792 LLSD w;
793 w = v;
794 }
795
796 {
797 SDAllocationCheck check("assign integer value", 1);
798 LLSD v = 45;
799 v = 33;
800 v = 0;
801 }
802
803 {
804 SDAllocationCheck check("copy construct integer", 1);
805 LLSD v = 45;
806 LLSD w = v;
807 }
808
809 {
810 SDAllocationCheck check("assign integer", 1);
811 LLSD v = 45;
812 LLSD w;
813 w = v;
814 }
815
816 {
817 SDAllocationCheck check("avoids extra clone", 2);
818 LLSD v = 45;
819 LLSD w = v;
820 w = "nice day";
821 }
822 }
823
824 /* TO DO:
825 conversion of undefined to UUID, Date, URI and Binary
826 conversion of undefined to map and array
827 test map operations
828 test array operations
829 test array extension
830
831 test copying and assign maps and arrays (clone)
832 test iteration over map
833 test iteration over array
834 test iteration over scalar
835
836 test empty map and empty array are indeed shared
837 test serializations
838 */
839}
840
diff --git a/linden/indra/test/llsdserialize_tut.cpp b/linden/indra/test/llsdserialize_tut.cpp
new file mode 100644
index 0000000..c87d7d1
--- /dev/null
+++ b/linden/indra/test/llsdserialize_tut.cpp
@@ -0,0 +1,558 @@
1/**
2 * @file llsdserialize_tut.cpp
3 * @date April 2006
4 * @brief LLSDSerialize unit tests
5 *
6 * Copyright (c) 2006-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#include <math.h>
30#include <sstream>
31#include <tut/tut.h>
32
33#include "llsd.h"
34#include "llsdserialize.h"
35#include "lltut.h"
36
37
38namespace tut
39{
40 struct sd_xml_data
41 {
42 sd_xml_data()
43 {
44 mFormatter = new LLSDXMLFormatter;
45 }
46 LLSD mSD;
47 LLPointer<LLSDXMLFormatter> mFormatter;
48 void xml_test(const char* name, const std::string& expected)
49 {
50 std::ostringstream ostr;
51 mFormatter->format(mSD, ostr);
52 ensure_equals(name, ostr.str(), expected);
53 }
54 };
55
56 typedef test_group<sd_xml_data> sd_xml_test;
57 typedef sd_xml_test::object sd_xml_object;
58 tut::sd_xml_test sd_xml_stream("sd_xml_serialization");
59
60 template<> template<>
61 void sd_xml_object::test<1>()
62 {
63 // random atomic tests
64 std::string expected;
65
66 expected = "<llsd><undef /></llsd>\n";
67 xml_test("undef", expected);
68
69 mSD = 3463;
70 expected = "<llsd><integer>3463</integer></llsd>\n";
71 xml_test("integer", expected);
72
73 mSD = "";
74 expected = "<llsd><string /></llsd>\n";
75 xml_test("empty string", expected);
76
77 mSD = "foobar";
78 expected = "<llsd><string>foobar</string></llsd>\n";
79 xml_test("string", expected);
80
81 mSD = LLUUID::null;
82 expected = "<llsd><uuid /></llsd>\n";
83 xml_test("null uuid", expected);
84
85 mSD = LLUUID("c96f9b1e-f589-4100-9774-d98643ce0bed");
86 expected = "<llsd><uuid>c96f9b1e-f589-4100-9774-d98643ce0bed</uuid></llsd>\n";
87 xml_test("uuid", expected);
88
89 mSD = LLURI("https://secondlife.com/login");
90 expected = "<llsd><uri>https://secondlife.com/login</uri></llsd>\n";
91 xml_test("uri", expected);
92
93 mSD = LLDate("2006-04-24T16:11:33Z");
94 expected = "<llsd><date>2006-04-24T16:11:33Z</date></llsd>\n";
95 xml_test("date", expected);
96
97 // *FIX: test binary
98 }
99
100 template<> template<>
101 void sd_xml_object::test<2>()
102 {
103 // tests with boolean values.
104 std::string expected;
105
106 mFormatter->boolalpha(true);
107 mSD = true;
108 expected = "<llsd><boolean>true</boolean></llsd>\n";
109 xml_test("bool alpha true", expected);
110 mSD = false;
111 expected = "<llsd><boolean>false</boolean></llsd>\n";
112 xml_test("bool alpha false", expected);
113
114 mFormatter->boolalpha(false);
115 mSD = true;
116 expected = "<llsd><boolean>1</boolean></llsd>\n";
117 xml_test("bool true", expected);
118 mSD = false;
119 expected = "<llsd><boolean>0</boolean></llsd>\n";
120 xml_test("bool false", expected);
121 }
122
123
124 template<> template<>
125 void sd_xml_object::test<3>()
126 {
127 // tests with real values.
128 std::string expected;
129
130 mFormatter->realFormat("%.2f");
131 mSD = 1.0;
132 expected = "<llsd><real>1.00</real></llsd>\n";
133 xml_test("real 1", expected);
134
135 mSD = -34379.0438;
136 expected = "<llsd><real>-34379.04</real></llsd>\n";
137 xml_test("real reduced precision", expected);
138 mFormatter->realFormat("%.4f");
139 expected = "<llsd><real>-34379.0438</real></llsd>\n";
140 xml_test("higher precision", expected);
141
142 mFormatter->realFormat("%.0f");
143 mSD = 0.0;
144 expected = "<llsd><real>0</real></llsd>\n";
145 xml_test("no decimal 0", expected);
146 mSD = 3287.4387;
147 expected = "<llsd><real>3287</real></llsd>\n";
148 xml_test("no decimal real number", expected);
149 }
150
151 template<> template<>
152 void sd_xml_object::test<4>()
153 {
154 // tests with arrays
155 std::string expected;
156
157 mSD = LLSD::emptyArray();
158 expected = "<llsd><array /></llsd>\n";
159 xml_test("empty array", expected);
160
161 mSD.append(LLSD());
162 expected = "<llsd><array><undef /></array></llsd>\n";
163 xml_test("1 element array", expected);
164
165 mSD.append(1);
166 expected = "<llsd><array><undef /><integer>1</integer></array></llsd>\n";
167 xml_test("2 element array", expected);
168 }
169
170 template<> template<>
171 void sd_xml_object::test<5>()
172 {
173 // tests with arrays
174 std::string expected;
175
176 mSD = LLSD::emptyMap();
177 expected = "<llsd><map /></llsd>\n";
178 xml_test("empty map", expected);
179
180 mSD["foo"] = "bar";
181 expected = "<llsd><map><key>foo</key><string>bar</string></map></llsd>\n";
182 xml_test("1 element map", expected);
183
184 mSD["baz"] = LLSD();
185 expected = "<llsd><map><key>baz</key><undef /><key>foo</key><string>bar</string></map></llsd>\n";
186 xml_test("2 element map", expected);
187 }
188
189
190 class TestLLSDSerializeData
191 {
192 public:
193 TestLLSDSerializeData();
194 ~TestLLSDSerializeData();
195
196 void doRoundTripTests(const std::string&);
197 void checkRoundTrip(const std::string&, const LLSD& v);
198
199 LLPointer<LLSDFormatter> mFormatter;
200 LLPointer<LLSDParser> mParser;
201 };
202
203 TestLLSDSerializeData::TestLLSDSerializeData()
204 {
205 }
206
207 TestLLSDSerializeData::~TestLLSDSerializeData()
208 {
209 }
210
211 void TestLLSDSerializeData::checkRoundTrip(const std::string& msg, const LLSD& v)
212 {
213 std::stringstream stream;
214 mFormatter->format(v, stream);
215 LLSD w;
216 mParser->parse(stream, w);
217
218 try
219 {
220 ensure_equals(msg, w, v);
221 }
222 catch (...)
223 {
224 std::cerr << "the serialized string was:" << std::endl;
225 std::cerr << stream.str() << std::endl;
226 throw;
227 }
228 }
229
230 void TestLLSDSerializeData::doRoundTripTests(const std::string& msg)
231 {
232 LLSD v;
233 checkRoundTrip(msg + " undefined", v);
234
235 v = true;
236 checkRoundTrip(msg + " true bool", v);
237
238 v = false;
239 checkRoundTrip(msg + " false bool", v);
240
241 v = 1;
242 checkRoundTrip(msg + " positive int", v);
243
244 v = 0;
245 checkRoundTrip(msg + " zero int", v);
246
247 v = -1;
248 checkRoundTrip(msg + " negative int", v);
249
250 v = 1234.5f;
251 checkRoundTrip(msg + " positive float", v);
252
253 v = 0.0f;
254 checkRoundTrip(msg + " zero float", v);
255
256 v = -1234.5f;
257 checkRoundTrip(msg + " negative float", v);
258
259 // FIXME: need a NaN test
260
261 v = LLUUID::null;
262 checkRoundTrip(msg + " null uuid", v);
263
264 LLUUID newUUID;
265 newUUID.generate();
266 v = newUUID;
267 checkRoundTrip(msg + " new uuid", v);
268
269 v = "";
270 checkRoundTrip(msg + " empty string", v);
271
272 v = "some string";
273 checkRoundTrip(msg + " non-empty string", v);
274
275 v =
276"Second Life is a 3-D virtual world entirely built and owned by its residents. "
277"Since opening to the public in 2003, it has grown explosively and today is "
278"inhabited by nearly 100,000 people from around the globe.\n"
279"\n"
280"From the moment you enter the World you’ll discover a vast digital continent, "
281"teeming with people, entertainment, experiences and opportunity. Once you’ve "
282"explored a bit, perhaps you’ll find a perfect parcel of land to build your "
283"house or business.\n"
284"\n"
285"You’ll also be surrounded by the Creations of your fellow residents. Because "
286"residents retain the rights to their digital creations, they can buy, sell "
287"and trade with other residents.\n"
288"\n"
289"The Marketplace currently supports millions of US dollars in monthly "
290"transactions. This commerce is handled with the in-world currency, the Linden "
291"dollar, which can be converted to US dollars at several thriving online "
292"currency exchanges.\n"
293"\n"
294"Welcome to Second Life. We look forward to seeing you in-world!\n"
295 ;
296 checkRoundTrip(msg + " long string", v);
297
298 static const U32 block_size = 0x000020;
299 for (U32 block = 0x000000; block <= 0x10ffff; block += block_size)
300 {
301 std::ostringstream out;
302
303 for (U32 c = block; c < block + block_size; ++c)
304 {
305 if (c <= 0x000001f
306 && c != 0x000009
307 && c != 0x00000a)
308 {
309 // see XML standard, sections 2.2 and 4.1
310 continue;
311 }
312 if (0x00d800 <= c && c <= 0x00dfff) { continue; }
313 if (0x00fdd0 <= c && c <= 0x00fdef) { continue; }
314 if ((c & 0x00fffe) == 0x00fffe) { continue; }
315 // see Unicode standard, section 15.8
316
317 if (c <= 0x00007f)
318 {
319 out << (char)(c & 0x7f);
320 }
321 else if (c <= 0x0007ff)
322 {
323 out << (char)(0xc0 | ((c >> 6) & 0x1f));
324 out << (char)(0x80 | ((c >> 0) & 0x3f));
325 }
326 else if (c <= 0x00ffff)
327 {
328 out << (char)(0xe0 | ((c >> 12) & 0x0f));
329 out << (char)(0x80 | ((c >> 6) & 0x3f));
330 out << (char)(0x80 | ((c >> 0) & 0x3f));
331 }
332 else
333 {
334 out << (char)(0xf0 | ((c >> 18) & 0x07));
335 out << (char)(0x80 | ((c >> 12) & 0x3f));
336 out << (char)(0x80 | ((c >> 6) & 0x3f));
337 out << (char)(0x80 | ((c >> 0) & 0x3f));
338 }
339 }
340
341 v = out.str();
342
343 std::ostringstream blockmsg;
344 blockmsg << msg << " unicode string block 0x" << std::hex << block;
345 checkRoundTrip(blockmsg.str(), v);
346 }
347
348 LLDate epoch;
349 v = epoch;
350 checkRoundTrip(msg + " epoch date", v);
351
352 LLDate aDay("2002-12-07T05:07:15.00Z");
353 v = aDay;
354 checkRoundTrip(msg + " date", v);
355
356 LLURI path("http://slurl.com/secondlife/Ambleside/57/104/26/");
357 v = path;
358 checkRoundTrip(msg + " url", v);
359
360 const char source[] = "it must be a blue moon again";
361 std::vector<U8> data;
362 copy(&source[0], &source[sizeof(source)], back_inserter(data));
363
364 v = data;
365 checkRoundTrip(msg + " binary", v);
366
367 v = LLSD::emptyMap();
368 checkRoundTrip(msg + " empty map", v);
369
370 v = LLSD::emptyMap();
371 v["name"] = "luke"; //v.insert("name", "luke");
372 v["age"] = 3; //v.insert("age", 3);
373 checkRoundTrip(msg + " map", v);
374
375 v.clear();
376 v["a"]["1"] = true;
377 v["b"]["0"] = false;
378 checkRoundTrip(msg + " nested maps", v);
379
380 v = LLSD::emptyArray();
381 checkRoundTrip(msg + " empty array", v);
382
383 v = LLSD::emptyArray();
384 v.append("ali");
385 v.append(28);
386 checkRoundTrip(msg + " array", v);
387
388 v.clear();
389 v[0][0] = true;
390 v[1][0] = false;
391 checkRoundTrip(msg + " nested arrays", v);
392 }
393
394 typedef tut::test_group<TestLLSDSerializeData> TestLLSDSerialzeGroup;
395 typedef TestLLSDSerialzeGroup::object TestLLSDSerializeObject;
396 TestLLSDSerialzeGroup gTestLLSDSerializeGroup("llsd serialization");
397
398 template<> template<>
399 void TestLLSDSerializeObject::test<1>()
400 {
401 mFormatter = new LLSDNotationFormatter();
402 mParser = new LLSDNotationParser();
403 doRoundTripTests("notation serialization");
404 }
405
406 template<> template<>
407 void TestLLSDSerializeObject::test<2>()
408 {
409 mFormatter = new LLSDXMLFormatter();
410 mParser = new LLSDXMLParser();
411 doRoundTripTests("xml serialization");
412 }
413
414 template<> template<>
415 void TestLLSDSerializeObject::test<3>()
416 {
417 mFormatter = new LLSDBinaryFormatter();
418 mParser = new LLSDBinaryParser();
419 doRoundTripTests("binary serialization");
420 }
421
422
423
424
425 class TestLLSDXMLParsing
426 {
427 public:
428 TestLLSDXMLParsing()
429 {
430 mParser = new LLSDXMLParser;
431 }
432 void ensureParse(const std::string& msg, const char* xml, const LLSD& expected);
433
434 LLPointer<LLSDXMLParser> mParser;
435 };
436
437 void TestLLSDXMLParsing::ensureParse(
438 const std::string& msg, const char* xmlstring, const LLSD& expected)
439 {
440 std::stringstream input;
441 input.str(xmlstring);
442
443 LLSD parsedResult;
444 mParser->parse(input, parsedResult);
445
446 ensure_equals(msg, parsedResult, expected);
447 }
448
449
450 typedef tut::test_group<TestLLSDXMLParsing> TestLLSDXMLParsingGroup;
451 typedef TestLLSDXMLParsingGroup::object TestLLSDXMLParsingObject;
452 TestLLSDXMLParsingGroup gTestLLSDXMLParsingGroup("llsd XML parsing");
453
454 template<> template<>
455 void TestLLSDXMLParsingObject::test<1>()
456 {
457 // test handling of xml not recognized as llsd results in an LLSD Undefined"
458
459 ensureParse("malformed xml", "<llsd><string>ha ha</string>", LLSD());
460 ensureParse("not llsd", "<html><body><p>ha ha</p></body></html>", LLSD());
461 ensureParse("value without llsd", "<string>ha ha</string>", LLSD());
462 ensureParse("key without llsd", "<key>ha ha</key>", LLSD());
463 }
464
465
466 template<> template<>
467 void TestLLSDXMLParsingObject::test<2>()
468 {
469 // test handling of unrecognized or unparseable llsd values
470
471 LLSD v;
472 v["amy"] = 23;
473 v["bob"] = LLSD();
474 v["cam"] = 1.23;
475
476 ensureParse("unknown data type",
477 "<llsd><map>"
478 "<key>amy</key><integer>23</integer>"
479 "<key>bob</key><bigint>99999999999999999</bigint>"
480 "<key>cam</key><real>1.23</real>"
481 "</map></llsd>", v);
482 }
483
484 template<> template<>
485 void TestLLSDXMLParsingObject::test<3>()
486 {
487 // test handling of nested bad data
488
489 LLSD v;
490 v["amy"] = 23;
491 v["cam"] = 1.23;
492
493 ensureParse("map with html",
494 "<llsd><map>"
495 "<key>amy</key><integer>23</integer>"
496 "<html><body>ha ha</body></html>"
497 "<key>cam</key><real>1.23</real>"
498 "</map></llsd>", v);
499
500 v.clear();
501 v["amy"] = 23;
502 v["cam"] = 1.23;
503 ensureParse("map with value for key",
504 "<llsd><map>"
505 "<key>amy</key><integer>23</integer>"
506 "<string>ha ha</string>"
507 "<key>cam</key><real>1.23</real>"
508 "</map></llsd>", v);
509
510 v.clear();
511 v["amy"] = 23;
512 v["bob"] = LLSD::emptyMap();
513 v["cam"] = 1.23;
514 ensureParse("map with map of html",
515 "<llsd><map>"
516 "<key>amy</key><integer>23</integer>"
517 "<key>bob</key>"
518 "<map>"
519 "<html><body>ha ha</body></html>"
520 "</map>"
521 "<key>cam</key><real>1.23</real>"
522 "</map></llsd>", v);
523
524 v.clear();
525 v[0] = 23;
526 v[1] = LLSD();
527 v[2] = 1.23;
528
529 ensureParse("array value of html",
530 "<llsd><array>"
531 "<integer>23</integer>"
532 "<html><body>ha ha</body></html>"
533 "<real>1.23</real>"
534 "</array></llsd>", v);
535
536 v.clear();
537 v[0] = 23;
538 v[1] = LLSD::emptyMap();
539 v[2] = 1.23;
540 ensureParse("array with map of html",
541 "<llsd><array>"
542 "<integer>23</integer>"
543 "<map>"
544 "<html><body>ha ha</body></html>"
545 "</map>"
546 "<real>1.23</real>"
547 "</array></llsd>", v);
548 }
549
550
551 /*
552 TODO:
553 test XML parsing
554 binary with unrecognized encoding
555 nested LLSD tags
556 multiple values inside an LLSD
557 */
558}
diff --git a/linden/indra/test/lltiming_tut.cpp b/linden/indra/test/lltiming_tut.cpp
new file mode 100644
index 0000000..0b503cb
--- /dev/null
+++ b/linden/indra/test/lltiming_tut.cpp
@@ -0,0 +1,112 @@
1/**
2 * @file lltiming_tut.cpp
3 * @date 2006-07-23
4 * @brief Tests the timers.
5 *
6 * Copyright (c) 2006-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#include "linden_common.h"
30#include "lltut.h"
31
32#include "llframetimer.h"
33#include "llsd.h"
34
35namespace tut
36{
37 struct frametimer_test
38 {
39 frametimer_test()
40 {
41 LLFrameTimer::updateFrameTime();
42 }
43 };
44 typedef test_group<frametimer_test> frametimer_group_t;
45 typedef frametimer_group_t::object frametimer_object_t;
46 tut::frametimer_group_t frametimer_instance("frametimer");
47
48 template<> template<>
49 void frametimer_object_t::test<1>()
50 {
51 F64 seconds_since_epoch = LLFrameTimer::getTotalSeconds();
52 LLFrameTimer timer;
53 timer.setExpiryAt(seconds_since_epoch);
54 F64 expires_at = timer.expiresAt();
55 ensure_distance(
56 "set expiry matches get expiry",
57 expires_at,
58 seconds_since_epoch,
59 0.001);
60 }
61
62 template<> template<>
63 void frametimer_object_t::test<2>()
64 {
65 F64 seconds_since_epoch = LLFrameTimer::getTotalSeconds();
66 seconds_since_epoch += 10.0;
67 LLFrameTimer timer;
68 timer.setExpiryAt(seconds_since_epoch);
69 F64 expires_at = timer.expiresAt();
70 ensure_distance(
71 "set expiry matches get expiry 1",
72 expires_at,
73 seconds_since_epoch,
74 0.001);
75 seconds_since_epoch += 10.0;
76 timer.setExpiryAt(seconds_since_epoch);
77 expires_at = timer.expiresAt();
78 ensure_distance(
79 "set expiry matches get expiry 2",
80 expires_at,
81 seconds_since_epoch,
82 0.001);
83 }
84 template<> template<>
85 void frametimer_object_t::test<3>()
86 {
87 F64 seconds_since_epoch = LLFrameTimer::getTotalSeconds();
88 seconds_since_epoch += 2.0;
89 LLFrameTimer timer;
90 timer.setExpiryAt(seconds_since_epoch);
91 ensure("timer not expired on create", !timer.hasExpired());
92 int ii;
93 for(ii = 0; ii < 10; ++ii)
94 {
95 ms_sleep(150);
96 LLFrameTimer::updateFrameTime();
97 }
98 ensure("timer not expired after a bit", !timer.hasExpired());
99 for(ii = 0; ii < 10; ++ii)
100 {
101 ms_sleep(100);
102 LLFrameTimer::updateFrameTime();
103 }
104 ensure("timer expired", timer.hasExpired());
105 }
106/*
107 template<> template<>
108 void frametimer_object_t::test<4>()
109 {
110 }
111*/
112}
diff --git a/linden/indra/test/lltut.cpp b/linden/indra/test/lltut.cpp
new file mode 100644
index 0000000..31b83e6
--- /dev/null
+++ b/linden/indra/test/lltut.cpp
@@ -0,0 +1,168 @@
1/**
2 * @file lltut.cpp
3 * @author Mark Lentczner
4 * @date 5/16/06
5 * @brief MacTester
6 *
7 * Copyright (c) 2006-2007, Linden Research, Inc.
8 *
9 * The source code in this file ("Source Code") is provided by Linden Lab
10 * to you under the terms of the GNU General Public License, version 2.0
11 * ("GPL"), unless you have obtained a separate licensing agreement
12 * ("Other License"), formally executed by you and Linden Lab. Terms of
13 * the GPL can be found in doc/GPL-license.txt in this distribution, or
14 * online at http://secondlife.com/developers/opensource/gplv2
15 *
16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlife.com/developers/opensource/flossexception
20 *
21 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above,
23 * and agree to abide by those obligations.
24 *
25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27 * COMPLETENESS OR PERFORMANCE.
28 */
29
30#include "lltut.h"
31#include "llsd.h"
32
33namespace tut
34{
35 template<>
36 void ensure_equals(const char* msg, const LLDate& actual,
37 const LLDate& expected)
38 {
39 ensure_equals(msg,
40 actual.secondsSinceEpoch(), expected.secondsSinceEpoch());
41 }
42
43 template<>
44 void ensure_equals(const char* msg, const LLURI& actual,
45 const LLURI& expected)
46 {
47 ensure_equals(msg,
48 actual.asString(), expected.asString());
49 }
50
51 template<>
52 void ensure_equals(const char* msg,
53 const std::vector<U8>& actual, const std::vector<U8>& expected)
54 {
55 std::string s(msg);
56
57 ensure_equals(s + " size", actual.size(), expected.size());
58
59 std::vector<U8>::const_iterator i, j;
60 int k;
61 for (i = actual.begin(), j = expected.begin(), k = 0;
62 i != actual.end();
63 ++i, ++j, ++k)
64 {
65 ensure_equals(s + " field", *i, *j);
66 }
67 }
68
69 template<>
70 void ensure_equals(const char* m, const LLSD& actual,
71 const LLSD& expected)
72 {
73 const std::string& msg = m;
74
75 ensure_equals(msg + " type", actual.type(), expected.type());
76 switch (actual.type())
77 {
78 case LLSD::TypeUndefined:
79 return;
80
81 case LLSD::TypeBoolean:
82 ensure_equals(msg + " boolean", actual.asBoolean(), expected.asBoolean());
83 return;
84
85 case LLSD::TypeInteger:
86 ensure_equals(msg + " integer", actual.asInteger(), expected.asInteger());
87 return;
88
89 case LLSD::TypeReal:
90 ensure_equals(msg + " real", actual.asReal(), expected.asReal());
91 return;
92
93 case LLSD::TypeString:
94 ensure_equals(msg + " string", actual.asString(), expected.asString());
95 return;
96
97 case LLSD::TypeUUID:
98 ensure_equals(msg + " uuid", actual.asUUID(), expected.asUUID());
99 return;
100
101 case LLSD::TypeDate:
102 ensure_equals(msg + " date", actual.asDate(), expected.asDate());
103 return;
104
105 case LLSD::TypeURI:
106 ensure_equals(msg + " uri", actual.asURI(), expected.asURI());
107 return;
108
109 case LLSD::TypeBinary:
110 ensure_equals(msg + " binary", actual.asBinary(), expected.asBinary());
111 return;
112
113 case LLSD::TypeMap:
114 {
115 ensure_equals(msg + " map size", actual.size(), expected.size());
116
117 LLSD::map_const_iterator actual_iter = actual.beginMap();
118 LLSD::map_const_iterator expected_iter = expected.beginMap();
119
120 while(actual_iter != actual.endMap())
121 {
122 ensure_equals(msg + " map keys",
123 actual_iter->first, expected_iter->first);
124 ensure_equals(msg + "[" + actual_iter->first + "]",
125 actual_iter->second, expected_iter->second);
126 ++actual_iter;
127 ++expected_iter;
128 }
129 return;
130 }
131 case LLSD::TypeArray:
132 {
133 ensure_equals(msg + " array size", actual.size(), expected.size());
134
135 for(int i = 0; i < actual.size(); ++i)
136 {
137 ensure_equals(msg + llformat("[%d]", i),
138 actual[i], expected[i]);
139 }
140 return;
141 }
142 }
143 }
144
145 void ensure_starts_with(const std::string& msg,
146 const std::string& actual, const std::string& expectedStart)
147 {
148 if( actual.find(expectedStart, 0) != 0 )
149 {
150 std::stringstream ss;
151 ss << msg << ": " << "expected to find " << expectedStart
152 << " at start of actual " << actual;
153 throw failure(ss.str().c_str());
154 }
155 }
156
157 void ensure_contains(const std::string& msg,
158 const std::string& actual, const std::string& expectedSubString)
159 {
160 if( actual.find(expectedSubString, 0) == std::string::npos )
161 {
162 std::stringstream ss;
163 ss << msg << ": " << "expected to find " << expectedSubString
164 << " in actual " << actual;
165 throw failure(ss.str().c_str());
166 }
167 }
168}
diff --git a/linden/indra/test/lltut.h b/linden/indra/test/lltut.h
new file mode 100644
index 0000000..ba3df24
--- /dev/null
+++ b/linden/indra/test/lltut.h
@@ -0,0 +1,95 @@
1/**
2 * @file lltut.h
3 * @author Phoenix
4 * @date 2005-09-26
5 * @brief helper tut methods
6 *
7 * Copyright (c) 2005-2007, Linden Research, Inc.
8 *
9 * The source code in this file ("Source Code") is provided by Linden Lab
10 * to you under the terms of the GNU General Public License, version 2.0
11 * ("GPL"), unless you have obtained a separate licensing agreement
12 * ("Other License"), formally executed by you and Linden Lab. Terms of
13 * the GPL can be found in doc/GPL-license.txt in this distribution, or
14 * online at http://secondlife.com/developers/opensource/gplv2
15 *
16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlife.com/developers/opensource/flossexception
20 *
21 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above,
23 * and agree to abide by those obligations.
24 *
25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27 * COMPLETENESS OR PERFORMANCE.
28 */
29
30/**
31 *
32 * THOROUGH_DESCRIPTION
33 *
34 */
35
36#ifndef LL_LLTUT_H
37#define LL_LLTUT_H
38
39#include <tut/tut.h>
40
41#include "lldate.h"
42#include "lluri.h"
43
44class LLSD;
45
46namespace tut
47{
48 template <class T,class Q>
49 void ensure_not_equals(const char* msg,const Q& actual,const T& expected)
50 {
51 if( expected == actual )
52 {
53 std::stringstream ss;
54 ss << (msg?msg:"") << (msg?": ":"") << "both equal " << expected;
55 throw tut::failure(ss.str().c_str());
56 }
57 }
58
59 template <class T,class Q>
60 void ensure_not_equals(const Q& actual,const T& expected)
61 {
62 ensure_not_equals(NULL, actual, expected);
63 }
64
65
66 template <class T,class Q>
67 void ensure_equals(const std::string& msg,
68 const Q& actual,const T& expected)
69 { ensure_equals(msg.c_str(), actual, expected); }
70
71 template<>
72 void ensure_equals(const char* msg,
73 const LLDate& actual, const LLDate& expected);
74
75 template<>
76 void ensure_equals(const char* msg,
77 const LLURI& actual, const LLURI& expected);
78
79 template<>
80 void ensure_equals(const char* msg,
81 const std::vector<U8>& actual, const std::vector<U8>& expected);
82
83 template<>
84 void ensure_equals(const char* msg,
85 const LLSD& actual, const LLSD& expected);
86
87 void ensure_starts_with(const std::string& msg,
88 const std::string& actual, const std::string& expectedStart);
89
90 void ensure_contains(const std::string& msg,
91 const std::string& actual, const std::string& expectedSubString);
92}
93
94
95#endif // LL_LLTUT_H
diff --git a/linden/indra/test/lluri_tut.cpp b/linden/indra/test/lluri_tut.cpp
new file mode 100644
index 0000000..acd67cf
--- /dev/null
+++ b/linden/indra/test/lluri_tut.cpp
@@ -0,0 +1,221 @@
1/**
2 * @file lluri_tut.cpp
3 * @brief LLURI unit tests
4 * @date September 2006
5 *
6 * Copyright (c) 2006-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#include <tut/tut.h>
30#include "lltut.h"
31
32#include "llsd.h"
33#include "lluri.h"
34#include "llhost.h"
35
36namespace tut
37{
38 struct URITestData {
39 void checkParts(const std::string& uriString,
40 const char* expectedScheme,
41 const char* expectedOpaque,
42 const char* expectedAuthority,
43 const char* expectedPath,
44 const char* expectedQuery)
45 {
46 LLURI u(uriString);
47
48 ensure_equals("scheme", u.scheme(), expectedScheme);
49 ensure_equals("opaque", u.opaque(), expectedOpaque);
50 ensure_equals("authority", u.authority(), expectedAuthority);
51 ensure_equals("path", u.path(), expectedPath);
52 ensure_equals("query", u.query(), expectedQuery);
53 }
54
55 void checkPartsHTTP(const char* host_and_port,
56 const LLSD& path,
57 const char* expectedOpaque,
58 const char* expectedAuthority,
59 const char* expectedPath)
60 {
61 LLURI u = LLURI::buildHTTP(host_and_port, path);
62 ensure_equals("scheme", u.scheme(), "HTTP");
63 ensure_equals("opaque", u.opaque(), expectedOpaque);
64 ensure_equals("authority", u.authority(), expectedAuthority);
65 ensure_equals("path", u.path(), expectedPath);
66 ensure_equals("query", u.query(), "");
67 }
68
69 void checkPartsHTTP(const char* host_and_port,
70 const LLSD& path,
71 const LLSD& args,
72 const char* expectedOpaque,
73 const char* expectedAuthority,
74 const char* expectedPath,
75 const char* expectedQuery)
76 {
77 LLURI u = LLURI::buildHTTP(host_and_port, path, args);
78 ensure_equals("scheme", u.scheme(), "HTTP");
79 ensure_equals("opaque", u.opaque(), expectedOpaque);
80 ensure_equals("authority", u.authority(), expectedAuthority);
81 ensure_equals("path", u.path(), expectedPath);
82 ensure_equals("query", u.query(), expectedQuery);
83 }
84 };
85
86 typedef test_group<URITestData> URITestGroup;
87 typedef URITestGroup::object URITestObject;
88
89 URITestGroup uriTestGroup("LLURI");
90
91 template<> template<>
92 void URITestObject::test<1>()
93 {
94 LLURI u("http://abc.com/def/ghi?x=37&y=hello");
95
96 ensure_equals("scheme", u.scheme(), "http");
97 ensure_equals("authority", u.authority(), "abc.com");
98 ensure_equals("path", u.path(), "/def/ghi");
99 ensure_equals("query", u.query(), "x=37&y=hello");
100
101 ensure_equals("host name", u.hostName(), "abc.com");
102 ensure_equals("host port", u.hostPort(), 80);
103
104 LLSD query = u.queryMap();
105 ensure_equals("query x", query["x"].asInteger(), 37);
106 ensure_equals("query y", query["y"].asString(), "hello");
107
108 query = LLURI::queryMap("x=22.23&y=https://lindenlab.com/");
109 ensure_equals("query x", query["x"].asReal(), 22.23);
110 ensure_equals("query y", query["y"].asURI().asString(), "https://lindenlab.com/");
111 }
112
113 template<> template<>
114 void URITestObject::test<2>()
115 {
116 // empty string
117 checkParts("", "", "", "", "", "");
118 }
119
120 template<> template<>
121 void URITestObject::test<3>()
122 {
123 // no scheme
124 checkParts("foo", "", "foo", "", "", "");
125 checkParts("foo%3A", "", "foo:", "", "", "");
126 }
127
128 template<> template<>
129 void URITestObject::test<4>()
130 {
131 // scheme w/o paths
132 checkParts("mailto:zero@ll.com", "mailto", "zero@ll.com", "", "", "");
133 checkParts("silly://abc/def?foo", "silly", "//abc/def?foo", "", "", "");
134 }
135
136 template<> template<>
137 void URITestObject::test<5>()
138 {
139 // authority section
140 checkParts("http:///", "http", "///", "", "/", "");
141 checkParts("http://abc", "http", "//abc", "abc", "", "");
142 checkParts("http://a%2Fb/cd", "http", "//a/b/cd", "a/b", "/cd", "");
143 checkParts("http://host?", "http", "//host?", "host", "", "");
144 }
145
146 template<> template<>
147 void URITestObject::test<6>()
148 {
149 // path section
150 checkParts("http://host/a/b/", "http", "//host/a/b/",
151 "host", "/a/b/", "");
152 checkParts("http://host/a%3Fb/", "http", "//host/a?b/",
153 "host", "/a?b/", "");
154 checkParts("http://host/a:b/", "http", "//host/a:b/",
155 "host", "/a:b/", "");
156 }
157
158 template<> template<>
159 void URITestObject::test<7>()
160 {
161 // query string
162 checkParts("http://host/?", "http", "//host/?",
163 "host", "/", "");
164 checkParts("http://host/?x", "http", "//host/?x",
165 "host", "/", "x");
166 checkParts("http://host/??", "http", "//host/??",
167 "host", "/", "?");
168 checkParts("http://host/?%3F", "http", "//host/??",
169 "host", "/", "?");
170 }
171
172 template<> template<>
173 void URITestObject::test<8>()
174 {
175 LLSD path;
176 path.append("x");
177 path.append("123");
178 checkPartsHTTP("host", path, "//host/x/123", "//host", "/x/123");
179 LLSD query;
180 query["123"] = "12";
181 query["abcd"] = "abc";
182 checkPartsHTTP("host", path, query, "//host/x/123?123=12&abcd=abc&", "//host", "/x/123", "123=12&abcd=abc&");
183 }
184
185 template<> template<>
186 void URITestObject::test<9>()
187 {
188 // test unescaped path components
189 LLSD path;
190 path.append("x@*//*$&^");
191 path.append("123");
192 checkPartsHTTP("host", path, "//host/x@*//*$&^/123", "//host", "/x@*//*$&^/123");
193 }
194
195 template<> template<>
196 void URITestObject::test<10>()
197 {
198 // test unescaped query components
199 LLSD path;
200 path.append("x");
201 path.append("123");
202 LLSD query;
203 query["123"] = "?&*#//";
204 query["**@&?//"] = "abc";
205 checkPartsHTTP("host", path, query, "//host/x/123?**@&?//=abc&123=?&*#//&", "//host", "/x/123", "**@&?//=abc&123=?&*#//&");
206 }
207
208 template<> template<>
209 void URITestObject::test<11>()
210 {
211 // test unescaped host components
212 LLSD path;
213 path.append("x");
214 path.append("123");
215 LLSD query;
216 query["123"] = "12";
217 query["abcd"] = "abc";
218 checkPartsHTTP("hi123*33--}{:portstuffs", path, query, "//hi123*33--}{:portstuffs/x/123?123=12&abcd=abc&", "//hi123*33--}{:portstuffs", "/x/123", "123=12&abcd=abc&");
219 }
220}
221
diff --git a/linden/indra/test/lluserrelations_tut.cpp b/linden/indra/test/lluserrelations_tut.cpp
new file mode 100644
index 0000000..e683803
--- /dev/null
+++ b/linden/indra/test/lluserrelations_tut.cpp
@@ -0,0 +1,157 @@
1/**
2 * @file lluserrelations_tut.cpp
3 * @author Phoenix
4 * @date 2006-10-12
5 * @brief Unit tests for the LLRelationship class.
6 *
7 * Copyright (c) 2006-2007, Linden Research, Inc.
8 *
9 * The source code in this file ("Source Code") is provided by Linden Lab
10 * to you under the terms of the GNU General Public License, version 2.0
11 * ("GPL"), unless you have obtained a separate licensing agreement
12 * ("Other License"), formally executed by you and Linden Lab. Terms of
13 * the GPL can be found in doc/GPL-license.txt in this distribution, or
14 * online at http://secondlife.com/developers/opensource/gplv2
15 *
16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlife.com/developers/opensource/flossexception
20 *
21 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above,
23 * and agree to abide by those obligations.
24 *
25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27 * COMPLETENESS OR PERFORMANCE.
28 */
29
30#include <tut/tut.h>
31
32#include "linden_common.h"
33#include "lluserrelations.h"
34
35namespace tut
36{
37 struct user_relationship
38 {
39 LLRelationship mRelationship;
40 };
41 typedef test_group<user_relationship> user_relationship_t;
42 typedef user_relationship_t::object user_relationship_object_t;
43 tut::user_relationship_t tut_user_relationship("relationships");
44
45 template<> template<>
46 void user_relationship_object_t::test<1>()
47 {
48 // Test the default construction
49 ensure(
50 "No granted rights to",
51 !mRelationship.isRightGrantedTo(
52 LLRelationship::GRANT_ONLINE_STATUS));
53 ensure(
54 "No granted rights from",
55 !mRelationship.isRightGrantedFrom(
56 LLRelationship::GRANT_ONLINE_STATUS));
57 ensure("No online status",!mRelationship.isOnline());
58 }
59
60 template<> template<>
61 void user_relationship_object_t::test<2>()
62 {
63 // Test some granting
64 mRelationship.grantRights(
65 LLRelationship::GRANT_ONLINE_STATUS,
66 LLRelationship::GRANT_MODIFY_OBJECTS);
67 ensure(
68 "Granted rights to has online",
69 mRelationship.isRightGrantedTo(
70 LLRelationship::GRANT_ONLINE_STATUS));
71 ensure(
72 "Granted rights from does not have online",
73 !mRelationship.isRightGrantedFrom(
74 LLRelationship::GRANT_ONLINE_STATUS));
75 ensure(
76 "Granted rights to does not have modify",
77 !mRelationship.isRightGrantedTo(
78 LLRelationship::GRANT_MODIFY_OBJECTS));
79 ensure(
80 "Granted rights from has modify",
81 mRelationship.isRightGrantedFrom(
82 LLRelationship::GRANT_MODIFY_OBJECTS));
83 }
84
85 template<> template<>
86 void user_relationship_object_t::test<3>()
87 {
88 // Test revoking
89 mRelationship.grantRights(
90 LLRelationship::GRANT_ONLINE_STATUS
91 | LLRelationship::GRANT_MAP_LOCATION,
92 LLRelationship::GRANT_ONLINE_STATUS);
93 ensure(
94 "Granted rights to has online and map",
95 mRelationship.isRightGrantedTo(
96 LLRelationship::GRANT_ONLINE_STATUS
97 | LLRelationship::GRANT_MAP_LOCATION));
98 ensure(
99 "Granted rights from has online",
100 mRelationship.isRightGrantedFrom(
101 LLRelationship::GRANT_ONLINE_STATUS));
102
103 mRelationship.revokeRights(
104 LLRelationship::GRANT_MAP_LOCATION,
105 LLRelationship::GRANT_NONE);
106 ensure(
107 "Granted rights revoked map",
108 !mRelationship.isRightGrantedTo(
109 LLRelationship::GRANT_ONLINE_STATUS
110 | LLRelationship::GRANT_MAP_LOCATION));
111 ensure(
112 "Granted rights revoked still has online",
113 mRelationship.isRightGrantedTo(
114 LLRelationship::GRANT_ONLINE_STATUS));
115
116 mRelationship.grantRights(
117 LLRelationship::GRANT_NONE,
118 LLRelationship::GRANT_MODIFY_OBJECTS);
119 ensure(
120 "Granted rights from still has online",
121 mRelationship.isRightGrantedFrom(
122 LLRelationship::GRANT_ONLINE_STATUS));
123 ensure(
124 "Granted rights from has full grant",
125 mRelationship.isRightGrantedFrom(
126 LLRelationship::GRANT_ONLINE_STATUS
127 | LLRelationship::GRANT_MODIFY_OBJECTS));
128 mRelationship.revokeRights(
129 LLRelationship::GRANT_NONE,
130 LLRelationship::GRANT_MODIFY_OBJECTS);
131 ensure(
132 "Granted rights from still has online",
133 mRelationship.isRightGrantedFrom(
134 LLRelationship::GRANT_ONLINE_STATUS));
135 ensure(
136 "Granted rights from no longer modify",
137 !mRelationship.isRightGrantedFrom(
138 LLRelationship::GRANT_MODIFY_OBJECTS));
139 }
140
141 template<> template<>
142 void user_relationship_object_t::test<4>()
143 {
144 ensure("No online status", !mRelationship.isOnline());
145 mRelationship.online(true);
146 ensure("Online status", mRelationship.isOnline());
147 mRelationship.online(false);
148 ensure("No online status", !mRelationship.isOnline());
149 }
150
151/*
152 template<> template<>
153 void user_relationship_object_t::test<>()
154 {
155 }
156*/
157}
diff --git a/linden/indra/test/math.cpp b/linden/indra/test/math.cpp
new file mode 100644
index 0000000..b14a798
--- /dev/null
+++ b/linden/indra/test/math.cpp
@@ -0,0 +1,133 @@
1/**
2 * @file math.cpp
3 * @author Phoenix
4 * @date 2005-09-26
5 * @brief Tests for the llmath library.
6 *
7 * Copyright (c) 2005-2007, Linden Research, Inc.
8 *
9 * The source code in this file ("Source Code") is provided by Linden Lab
10 * to you under the terms of the GNU General Public License, version 2.0
11 * ("GPL"), unless you have obtained a separate licensing agreement
12 * ("Other License"), formally executed by you and Linden Lab. Terms of
13 * the GPL can be found in doc/GPL-license.txt in this distribution, or
14 * online at http://secondlife.com/developers/opensource/gplv2
15 *
16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlife.com/developers/opensource/flossexception
20 *
21 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above,
23 * and agree to abide by those obligations.
24 *
25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27 * COMPLETENESS OR PERFORMANCE.
28 */
29
30#include "linden_common.h"
31#include "lltut.h"
32
33#include "llmath.h"
34#include "lluuid.h"
35
36namespace tut
37{
38 struct math_data
39 {
40 };
41 typedef test_group<math_data> math_test;
42 typedef math_test::object math_object;
43 tut::math_test tm("basic_linden_math");
44
45 template<> template<>
46 void math_object::test<1>()
47 {
48 S32 val = 89543;
49 val = llabs(val);
50 ensure("integer absolute value 1", (89543 == val));
51 val = -500;
52 val = llabs(val);
53 ensure("integer absolute value 2", (500 == val));
54 }
55
56 template<> template<>
57 void math_object::test<2>()
58 {
59 F32 val = -2583.4f;
60 val = llabs(val);
61 ensure("float absolute value 1", (2583.4f == val));
62 val = 430903.f;
63 val = llabs(val);
64 ensure("float absolute value 2", (430903.f == val));
65 }
66
67 template<> template<>
68 void math_object::test<3>()
69 {
70 F64 val = 387439393.987329839;
71 val = llabs(val);
72 ensure("double absolute value 1", (387439393.987329839 == val));
73 val = -8937843.9394878;
74 val = llabs(val);
75 ensure("double absolute value 2", (8937843.9394878 == val));
76 }
77}
78
79namespace tut
80{
81 struct uuid_data
82 {
83 LLUUID id;
84 };
85 typedef test_group<uuid_data> uuid_test;
86 typedef uuid_test::object uuid_object;
87 tut::uuid_test tu("uuid");
88
89 template<> template<>
90 void uuid_object::test<1>()
91 {
92 ensure("uuid null", id.isNull());
93 id.generate();
94 ensure("generate not null", id.notNull());
95 id.setNull();
96 ensure("set null", id.isNull());
97 }
98
99 template<> template<>
100 void uuid_object::test<2>()
101 {
102 id.generate();
103 LLUUID a(id);
104 ensure_equals("copy equal", id, a);
105 a.generate();
106 ensure_not_equals("generate not equal", id, a);
107 a = id;
108 ensure_equals("assignment equal", id, a);
109 }
110
111 template<> template<>
112 void uuid_object::test<3>()
113 {
114 id.generate();
115 LLUUID copy(id);
116 LLUUID mask;
117 mask.generate();
118 copy ^= mask;
119 ensure_not_equals("mask not equal", id, copy);
120 copy ^= mask;
121 ensure_equals("mask back", id, copy);
122 }
123
124 template<> template<>
125 void uuid_object::test<4>()
126 {
127 id.generate();
128 LLString id_str = id.getString();
129 LLUUID copy(id_str.c_str());
130 ensure_equals("string serialization", id, copy);
131 }
132
133}
diff --git a/linden/indra/test/reflection_tut.cpp b/linden/indra/test/reflection_tut.cpp
new file mode 100644
index 0000000..a7b46d4
--- /dev/null
+++ b/linden/indra/test/reflection_tut.cpp
@@ -0,0 +1,223 @@
1/**
2 * @file reflection_tut.cpp
3 * @date May 2006
4 * @brief Reflection unit tests.
5 *
6 * Copyright (c) 2006-2007, Linden Research, Inc.
7 *
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#include <tut/tut.h>
30
31#include "lltut.h"
32#include "reflective.h"
33#include "metaclasst.h"
34#include "metapropertyt.h"
35//#include "referencemetaproperty.h"
36#include "stdtypes.h"
37//#include "reflectivemetapropertyt.h"
38
39namespace tut
40{
41 class TestAggregatedData : public LLReflective
42 {
43 public:
44 TestAggregatedData() {;}
45 virtual const LLMetaClass& getMetaClass() const;
46
47 private:
48 };
49
50 class TestReflectionData : public LLReflective
51 {
52 public:
53 TestReflectionData() : mInt(42), mString("foo"), mNullPtr(NULL), mPtr(new TestAggregatedData()), mRef(*(new TestAggregatedData)) {;}
54 virtual ~TestReflectionData() {delete mPtr;}
55 virtual const LLMetaClass& getMetaClass() const;
56
57 static U32 getPropertyCount() {return 5;}
58
59 private:
60
61 friend class LLMetaClassT<TestReflectionData>;
62 S32 mInt;
63 std::string mString;
64 TestAggregatedData* mNullPtr;
65 TestAggregatedData* mPtr;
66 TestAggregatedData mObj;
67 TestAggregatedData& mRef;
68 };
69}
70
71template <>
72void LLMetaClassT<tut::TestReflectionData>::reflectProperties(LLMetaClass& meta_class)
73{
74 reflectProperty(meta_class, "mInt", &tut::TestReflectionData::mInt);
75 reflectProperty(meta_class, "mString", &tut::TestReflectionData::mString);
76 reflectPtrProperty(meta_class, "mNullPtr", &tut::TestReflectionData::mNullPtr);
77 reflectPtrProperty(meta_class, "mPtr", &tut::TestReflectionData::mPtr);
78 reflectProperty(meta_class, "mObj", &tut::TestReflectionData::mObj);
79 //reflectProperty(meta_class, "mRef", &tut::TestReflectionData::mRef); // AARGH!
80}
81
82namespace tut
83{
84 // virtual
85 const LLMetaClass& TestReflectionData::getMetaClass() const
86 {
87 return LLMetaClassT<TestReflectionData>::instance();
88 }
89
90 const LLMetaClass& TestAggregatedData::getMetaClass() const
91 {
92 return LLMetaClassT<TestAggregatedData>::instance();
93 }
94}
95
96namespace tut
97{
98 typedef tut::test_group<TestReflectionData> TestReflectionGroup;
99 typedef TestReflectionGroup::object TestReflectionObject;
100 TestReflectionGroup gTestReflectionGroup("reflection");
101
102 template<> template<>
103 void TestReflectionObject::test<1>()
104 {
105 // Check properties can be found.
106 const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
107 const LLMetaProperty* null = NULL;
108 ensure_not_equals(meta_class.findProperty("mInt"), null);
109 ensure_not_equals(meta_class.findProperty("mString"), null);
110 }
111
112 template<> template<>
113 void TestReflectionObject::test<2>()
114 {
115 // Check non-existent property cannot be found.
116 const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
117 const LLMetaProperty* null = NULL;
118 ensure_equals(meta_class.findProperty("foo"), null);
119 }
120
121 template<> template<>
122 void TestReflectionObject::test<3>()
123 {
124 // Check integer property has correct value.
125 const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
126 ensure_equals(meta_class.findProperty("mInt")->getLLSD(this).asInteger(), 42);
127 }
128
129 template<> template<>
130 void TestReflectionObject::test<4>()
131 {
132 // Check string property has correct value.
133 const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
134 ensure_equals(meta_class.findProperty("mString")->getLLSD(this).asString(), std::string("foo"));
135 }
136
137 template<> template<>
138 void TestReflectionObject::test<5>()
139 {
140 // Check NULL reference property has correct value.
141 const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
142 const LLReflective* null = NULL;
143 ensure_equals(meta_class.findProperty("mNullPtr")->get(this), null);
144 }
145
146 template<> template<>
147 void TestReflectionObject::test<6>()
148 {
149 // Check reference property has correct value.
150 const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
151 const LLReflective* null = NULL;
152 const LLReflective* ref = meta_class.findProperty("mPtr")->get(this);
153 ensure_not_equals(ref, null);
154 }
155
156 template<> template<>
157 void TestReflectionObject::test<7>()
158 {
159 // Check reflective property has correct value.
160 const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
161 const LLReflective* null = NULL;
162 const LLReflective* ref = meta_class.findProperty("mObj")->get(this);
163 ensure_not_equals(ref, null);
164 }
165
166 template<> template<>
167 void TestReflectionObject::test<8>()
168 {
169 // Check property count.
170 const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
171 ensure_equals(meta_class.getPropertyCount(), TestReflectionData::getPropertyCount());
172 }
173
174 template<> template<>
175 void TestReflectionObject::test<9>()
176 {
177 // Check property iteration.
178 const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
179 U32 count = 0;
180 LLMetaClass::PropertyIterator iter;
181 for(iter = meta_class.beginProperties(); iter != meta_class.endProperties(); ++iter)
182 {
183 ++count;
184 }
185 ensure_equals(count, TestReflectionData::getPropertyCount());
186 }
187
188 template<> template<>
189 void TestReflectionObject::test<10>()
190 {
191 // Check meta classes of different types do not compare equal.
192 const LLMetaClass* reflection_data_meta_class = &(LLMetaClassT<TestReflectionData>::instance());
193 const LLMetaClass* aggregated_data_meta_class = &(LLMetaClassT<TestAggregatedData>::instance());
194 ensure_not_equals(reflection_data_meta_class, aggregated_data_meta_class);
195 }
196
197 template<> template<>
198 void TestReflectionObject::test<11>()
199 {
200 // Check class cast checks.
201 const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
202 TestAggregatedData* aggregated_data = new TestAggregatedData();
203 LLMetaClass::PropertyIterator iter;
204 U32 exception_count = 0;
205 for(iter = meta_class.beginProperties(); iter != meta_class.endProperties(); ++iter)
206 {
207 try
208 {
209 const LLMetaProperty* property = (*iter).second;
210 const LLReflective* reflective = property->get(aggregated_data); // Wrong reflective type, should throw exception.
211
212 // useless op to get rid of compiler warning.
213 reflective = NULL;
214 }
215 catch(...)
216 {
217 ++exception_count;
218 }
219 }
220 ensure_equals(exception_count, getPropertyCount());
221
222 }
223}
diff --git a/linden/indra/test/test.cpp b/linden/indra/test/test.cpp
new file mode 100644
index 0000000..d90bfdb
--- /dev/null
+++ b/linden/indra/test/test.cpp
@@ -0,0 +1,267 @@
1/**
2 * @file test.cpp
3 * @author Phoenix
4 * @date 2005-09-26
5 * @brief Entry point for the test app.
6 *
7 * Copyright (c) 2005-2007, Linden Research, Inc.
8 *
9 * The source code in this file ("Source Code") is provided by Linden Lab
10 * to you under the terms of the GNU General Public License, version 2.0
11 * ("GPL"), unless you have obtained a separate licensing agreement
12 * ("Other License"), formally executed by you and Linden Lab. Terms of
13 * the GPL can be found in doc/GPL-license.txt in this distribution, or
14 * online at http://secondlife.com/developers/opensource/gplv2
15 *
16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlife.com/developers/opensource/flossexception
20 *
21 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above,
23 * and agree to abide by those obligations.
24 *
25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27 * COMPLETENESS OR PERFORMANCE.
28 */
29
30/**
31 *
32 * You can add tests by creating a new cpp file in this directory, and
33 * rebuilding. There are at most 50 tests per testgroup without a
34 * little bit of template parameter and makefile tweaking.
35 *
36 */
37
38#include "linden_common.h"
39#include "lltut.h"
40
41#include <apr-1/apr_pools.h>
42#include <apr-1/apr_getopt.h>
43
44// the CTYPE_WORKAROUND is needed for linux dev stations that don't
45// have the broken libc6 packages needed by our out-of-date static
46// libs (such as libcrypto and libcurl). -- Leviathan 20060113
47#ifdef CTYPE_WORKAROUND
48# include "ctype_workaround.h"
49#endif
50
51
52namespace tut
53{
54 test_runner_singleton runner;
55}
56
57class LLTestCallback : public tut::callback
58{
59public:
60 LLTestCallback(bool verbose_mode) :
61 mVerboseMode(verbose_mode),
62 mTotalTests(0),
63 mPassedTests(0),
64 mFailedTests(0)
65 {
66 }
67
68 void run_started()
69 {
70 //std::cout << "run_started" << std::endl;
71 }
72
73 void test_completed(const tut::test_result& tr)
74 {
75 ++mTotalTests;
76 std::ostringstream out;
77 out << "[" << tr.group << ", " << tr.test << "] ";
78 switch(tr.result)
79 {
80 case tut::test_result::ok:
81 ++mPassedTests;
82 out << "ok";
83 break;
84 case tut::test_result::fail:
85 ++mFailedTests;
86 out << "fail '" << tr.message << "'";
87 break;
88 case tut::test_result::ex:
89 ++mFailedTests;
90 out << "exception";
91 break;
92 case tut::test_result::warn:
93 ++mFailedTests;
94 out << "test destructor throw";
95 break;
96 case tut::test_result::term:
97 ++mFailedTests;
98 out << "abnormal termination";
99 break;
100 default:
101 ++mFailedTests;
102 out << "unknown";
103 }
104 if(mVerboseMode || (tr.result != tut::test_result::ok))
105 {
106 std::cout << out.str() << std::endl;
107 }
108 }
109
110 void run_completed()
111 {
112 std::cout << std::endl;
113 std::cout << "Total Tests: " << mTotalTests << std::endl;
114 std::cout << "Passed Tests : " << mPassedTests << std::endl;
115 if(mFailedTests > 0)
116 {
117 std::cout << "*********************************" << std::endl;
118 std::cout << "Failed Tests: " << mFailedTests << std::endl;
119 std::cout << "Please report or fix the problem." << std::endl;
120 std::cout << "*********************************" << std::endl;
121 exit(1);
122 }
123 }
124
125protected:
126 bool mVerboseMode;
127 S32 mTotalTests;
128 S32 mPassedTests;
129 S32 mFailedTests;
130};
131
132static const apr_getopt_option_t TEST_CL_OPTIONS[] =
133{
134 {"help", 'h', 0, "Print the help message."},
135 {"list", 'l', 0, "List available test groups."},
136 {"verbose", 'v', 0, "Verbose output."},
137 {"group", 'g', 1, "Run test group specified by option argument."},
138 {"wait", 'w', 0, "Wait for input before exit."},
139 {0, 0, 0, 0}
140};
141
142void stream_usage(std::ostream& s, const char* app)
143{
144 s << "Usage: " << app << " [OPTIONS]" << std::endl
145 << std::endl;
146
147 s << "This application runs the unit tests." << std::endl << std::endl;
148
149 s << "Options: " << std::endl;
150 const apr_getopt_option_t* option = &TEST_CL_OPTIONS[0];
151 while(option->name)
152 {
153 s << " ";
154 s << " -" << (char)option->optch << ", --" << option->name
155 << std::endl;
156 s << "\t" << option->description << std::endl << std::endl;
157 ++option;
158 }
159
160 s << "Examples:" << std::endl;
161 s << " " << app << " --verbose" << std::endl;
162 s << "\tRun all the tests and report all results." << std::endl;
163 s << " " << app << " --list" << std::endl;
164 s << "\tList all available test groups." << std::endl;
165 s << " " << app << " --group=uuid" << std::endl;
166 s << "\tRun the test group 'uuid'." << std::endl;
167}
168
169void stream_groups(std::ostream& s, const char* app)
170{
171 s << "Registered test groups:" << std::endl;
172 tut::groupnames gl = tut::runner.get().list_groups();
173 tut::groupnames::const_iterator it = gl.begin();
174 tut::groupnames::const_iterator end = gl.end();
175 for(; it != end; ++it)
176 {
177 s << " " << *(it) << std::endl;
178 }
179}
180
181int main(int argc, char **argv)
182{
183#ifdef CTYPE_WORKAROUND
184 ctype_workaround();
185#endif
186
187 apr_initialize();
188 apr_pool_t* pool = NULL;
189 if(APR_SUCCESS != apr_pool_create(&pool, NULL))
190 {
191 std::cerr << "Unable to initialize pool" << std::endl;
192 return 1;
193 }
194 apr_getopt_t* os = NULL;
195 if(APR_SUCCESS != apr_getopt_init(&os, pool, argc, argv))
196 {
197 std::cerr << "Unable to pool" << std::endl;
198 return 1;
199 }
200
201 // values used for controlling application
202 bool verbose_mode = false;
203 bool wait_at_exit = false;
204 std::string test_group;
205
206 // values use for options parsing
207 apr_status_t apr_err;
208 const char* opt_arg = NULL;
209 int opt_id = 0;
210 while(true)
211 {
212 apr_err = apr_getopt_long(os, TEST_CL_OPTIONS, &opt_id, &opt_arg);
213 if(APR_STATUS_IS_EOF(apr_err)) break;
214 if(apr_err)
215 {
216 char buf[255];
217 std::cerr << "Error parsing options: "
218 << apr_strerror(apr_err, buf, 255) << std::endl;
219 return 1;
220 }
221 switch (opt_id)
222 {
223 case 'g':
224 test_group.assign(opt_arg);
225 break;
226 case 'h':
227 stream_usage(std::cout, argv[0]);
228 return 0;
229 break;
230 case 'l':
231 stream_groups(std::cout, argv[0]);
232 return 0;
233 case 'v':
234 verbose_mode = true;
235 break;
236 case 'w':
237 wait_at_exit = true;
238 break;
239 default:
240 stream_usage(std::cerr, argv[0]);
241 return 1;
242 break;
243 }
244 }
245
246 // run the tests
247 LLTestCallback callback(verbose_mode);
248 tut::runner.get().set_callback(&callback);
249
250 if(test_group.empty())
251 {
252 tut::runner.get().run_tests();
253 }
254 else
255 {
256 tut::runner.get().run_tests(test_group);
257 }
258
259 if (wait_at_exit)
260 {
261 std::cerr << "Waiting for input before exiting..." << std::endl;
262 std::cin.get();
263 }
264
265 apr_terminate();
266 return 0;
267}
diff --git a/linden/indra/test/test.vcproj b/linden/indra/test/test.vcproj
new file mode 100644
index 0000000..64c247c
--- /dev/null
+++ b/linden/indra/test/test.vcproj
@@ -0,0 +1,244 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="7.10"
5 Name="test"
6 ProjectGUID="{BBAA6588-CA96-4A87-A988-B02270B8D02B}"
7 RootNamespace="test"
8 Keyword="Win32Proj">
9 <Platforms>
10 <Platform
11 Name="Win32"/>
12 </Platforms>
13 <Configurations>
14 <Configuration
15 Name="Debug|Win32"
16 OutputDirectory="Debug"
17 IntermediateDirectory="Debug"
18 ConfigurationType="1"
19 CharacterSet="2">
20 <Tool
21 Name="VCCLCompilerTool"
22 Optimization="0"
23 AdditionalIncludeDirectories="..\llcommon;..\llmessage;..\llmath;..\..\libraries\include;..\llinventory;&quot;..\..\libraries\i686-win32\include&quot;;..\llxml;..\lldatabase"
24 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;LL_WINDOWS;LL_DEBUG"
25 MinimalRebuild="FALSE"
26 BasicRuntimeChecks="3"
27 RuntimeLibrary="1"
28 RuntimeTypeInfo="TRUE"
29 UsePrecompiledHeader="0"
30 WarningLevel="3"
31 Detect64BitPortabilityProblems="FALSE"
32 DebugInformationFormat="3"/>
33 <Tool
34 Name="VCCustomBuildTool"/>
35 <Tool
36 Name="VCLinkerTool"
37 AdditionalOptions="/FORCE:MULTIPLE"
38 AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc71-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib llcommon.lib llprimitive.lib llvfs.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ole32.lib oleaut32.lib opengl32.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib"
39 OutputFile="$(OutDir)/test.exe"
40 LinkIncremental="2"
41 AdditionalLibraryDirectories="&quot;../lib_$(ConfigurationName)/i686-win32&quot;;&quot;../../libraries/i686-win32/lib_debug&quot;"
42 IgnoreDefaultLibraryNames="libcmt.lib"
43 GenerateDebugInformation="TRUE"
44 ProgramDatabaseFile="$(OutDir)/test.pdb"
45 SubSystem="1"
46 TargetMachine="1"/>
47 <Tool
48 Name="VCMIDLTool"/>
49 <Tool
50 Name="VCPostBuildEventTool"/>
51 <Tool
52 Name="VCPreBuildEventTool"/>
53 <Tool
54 Name="VCPreLinkEventTool"/>
55 <Tool
56 Name="VCResourceCompilerTool"/>
57 <Tool
58 Name="VCWebServiceProxyGeneratorTool"/>
59 <Tool
60 Name="VCXMLDataGeneratorTool"/>
61 <Tool
62 Name="VCWebDeploymentTool"/>
63 <Tool
64 Name="VCManagedWrapperGeneratorTool"/>
65 <Tool
66 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
67 </Configuration>
68 <Configuration
69 Name="Release|Win32"
70 OutputDirectory="Release"
71 IntermediateDirectory="Release"
72 ConfigurationType="1"
73 CharacterSet="2">
74 <Tool
75 Name="VCCLCompilerTool"
76 Optimization="0"
77 AdditionalIncludeDirectories="..\llcommon;..\llmessage;..\llmath;..\..\libraries\include;..\llinventory;&quot;..\..\libraries\i686-win32\include&quot;;..\llxml;..\lldatabase"
78 PreprocessorDefinitions="WIN32;__WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;LL_RELEASE;APR_DECLARE_STATIC;LL_HTTPD=1"
79 MinimalRebuild="FALSE"
80 BasicRuntimeChecks="3"
81 RuntimeLibrary="1"
82 ForceConformanceInForLoopScope="TRUE"
83 RuntimeTypeInfo="TRUE"
84 UsePrecompiledHeader="0"
85 WarningLevel="3"
86 Detect64BitPortabilityProblems="FALSE"
87 DebugInformationFormat="3"/>
88 <Tool
89 Name="VCCustomBuildTool"/>
90 <Tool
91 Name="VCLinkerTool"
92 AdditionalOptions="/FORCE:MULTIPLE"
93 AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc71-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib llcommon.lib llprimitive.lib llvfs.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ole32.lib oleaut32.lib opengl32.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib"
94 OutputFile="$(OutDir)/test.exe"
95 LinkIncremental="2"
96 AdditionalLibraryDirectories="&quot;../lib_$(ConfigurationName)/i686-win32&quot;;&quot;../../libraries/i686-win32/lib_release&quot;"
97 IgnoreDefaultLibraryNames="libcmt.lib"
98 GenerateDebugInformation="TRUE"
99 ProgramDatabaseFile="$(OutDir)/test.pdb"
100 SubSystem="1"
101 TargetMachine="1"/>
102 <Tool
103 Name="VCMIDLTool"/>
104 <Tool
105 Name="VCPostBuildEventTool"
106 CommandLine="$(TargetPath)"/>
107 <Tool
108 Name="VCPreBuildEventTool"/>
109 <Tool
110 Name="VCPreLinkEventTool"/>
111 <Tool
112 Name="VCResourceCompilerTool"/>
113 <Tool
114 Name="VCWebServiceProxyGeneratorTool"/>
115 <Tool
116 Name="VCXMLDataGeneratorTool"/>
117 <Tool
118 Name="VCWebDeploymentTool"/>
119 <Tool
120 Name="VCManagedWrapperGeneratorTool"/>
121 <Tool
122 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
123 </Configuration>
124 <Configuration
125 Name="ReleaseNoOpt|Win32"
126 OutputDirectory="$(ConfigurationName)"
127 IntermediateDirectory="$(ConfigurationName)"
128 ConfigurationType="1"
129 CharacterSet="2">
130 <Tool
131 Name="VCCLCompilerTool"
132 Optimization="0"
133 AdditionalIncludeDirectories="..\llcommon;..\llmessage;..\llmath;..\..\libraries\include;..\llinventory;&quot;..\..\libraries\i686-win32\include&quot;;..\llxml;..\lldatabase"
134 PreprocessorDefinitions="WIN32;__WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;LL_RELEASE;APR_DECLARE_STATIC;LL_HTTPD=1"
135 MinimalRebuild="FALSE"
136 BasicRuntimeChecks="3"
137 RuntimeLibrary="1"
138 ForceConformanceInForLoopScope="TRUE"
139 RuntimeTypeInfo="TRUE"
140 UsePrecompiledHeader="0"
141 WarningLevel="3"
142 Detect64BitPortabilityProblems="FALSE"
143 DebugInformationFormat="3"/>
144 <Tool
145 Name="VCCustomBuildTool"/>
146 <Tool
147 Name="VCLinkerTool"
148 AdditionalDependencies="advapi32.lib apr-1.lib aprutil-1.lib comdlg32.lib dinput8.lib dsound.lib dxerr8.lib dxguid.lib freetype.lib gdi32.lib glu32.lib jpeglib_6b.lib kernel32.lib libboost_regex-vc71-mt-s.lib libcurl.lib libeay32.lib libexpatMT.lib llcommon.lib llprimitive.lib llvfs.lib llxml.lib lscript_library.lib mswsock.lib netapi32.lib odbc32.lib odbccp32.lib ole32.lib oleaut32.lib opengl32.lib shell32.lib ssleay32.lib user32.lib Vfw32.lib winmm.lib winspool.lib ws2_32.lib xmlrpcepi.lib zlib.lib"
149 OutputFile="$(OutDir)/test.exe"
150 LinkIncremental="2"
151 AdditionalLibraryDirectories="&quot;../lib_$(ConfigurationName)/i686-win32&quot;;&quot;../../libraries/i686-win32/lib_release&quot;"
152 IgnoreDefaultLibraryNames="libcmt.lib"
153 GenerateDebugInformation="TRUE"
154 ProgramDatabaseFile="$(OutDir)/test.pdb"
155 SubSystem="1"
156 TargetMachine="1"/>
157 <Tool
158 Name="VCMIDLTool"/>
159 <Tool
160 Name="VCPostBuildEventTool"
161 CommandLine="$(TargetPath)"/>
162 <Tool
163 Name="VCPreBuildEventTool"/>
164 <Tool
165 Name="VCPreLinkEventTool"/>
166 <Tool
167 Name="VCResourceCompilerTool"/>
168 <Tool
169 Name="VCWebServiceProxyGeneratorTool"/>
170 <Tool
171 Name="VCXMLDataGeneratorTool"/>
172 <Tool
173 Name="VCWebDeploymentTool"/>
174 <Tool
175 Name="VCManagedWrapperGeneratorTool"/>
176 <Tool
177 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
178 </Configuration>
179 </Configurations>
180 <References>
181 </References>
182 <Files>
183 <Filter
184 Name="Source Files"
185 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
186 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
187 <File
188 RelativePath=".\common.cpp">
189 </File>
190 <File
191 RelativePath=".\inventory.cpp">
192 </File>
193 <File
194 RelativePath=".\io.cpp">
195 </File>
196
197 <File
198 RelativePath=".\llhttpclient_tut.cpp">
199 </File>
200 <File
201 RelativePath=".\llmime_tut.cpp">
202 </File>
203 <File
204 RelativePath=".\llpipeutil.cpp">
205 </File>
206 <File
207 RelativePath=".\llsd_message_system_tut.cpp">
208 </File>
209 <File
210 RelativePath=".\llsd_new_tut.cpp">
211 </File>
212 <File
213 RelativePath=".\llsdserialize_tut.cpp">
214 </File>
215 <File
216 RelativePath=".\lltut.cpp">
217 </File>
218 <File
219 RelativePath=".\math.cpp">
220 </File>
221 <File
222 RelativePath=".\reflection_tut.cpp">
223 </File>
224 <File
225 RelativePath=".\test.cpp">
226 </File>
227 </Filter>
228 <Filter
229 Name="Header Files"
230 Filter="h;hpp;hxx;hm;inl;inc;xsd"
231 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
232 <File
233 RelativePath=".\lltut.h">
234 </File>
235 </Filter>
236 <Filter
237 Name="Resource Files"
238 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
239 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
240 </Filter>
241 </Files>
242 <Globals>
243 </Globals>
244</VisualStudioProject>