From 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:46 -0500 Subject: Second Life viewer sources 1.13.2.12 --- .../indra/test/MacTester.xcodeproj/project.pbxproj | 1326 +++++++++++++++++++ linden/indra/test/common.cpp | 447 +++++++ linden/indra/test/files.lst | 18 + linden/indra/test/inventory.cpp | 167 +++ linden/indra/test/io.cpp | 1387 ++++++++++++++++++++ linden/indra/test/llapp_tut.cpp | 153 +++ linden/indra/test/llhttpclient_tut.cpp | 315 +++++ linden/indra/test/llhttpnode_tut.cpp | 428 ++++++ linden/indra/test/lliohttpserver_tut.cpp | 303 +++++ linden/indra/test/llmime_tut.cpp | 443 +++++++ linden/indra/test/llpipeutil.cpp | 158 +++ linden/indra/test/llpipeutil.h | 144 ++ linden/indra/test/llsd_message_system_tut.cpp | 142 ++ linden/indra/test/llsd_new_tut.cpp | 840 ++++++++++++ linden/indra/test/llsdserialize_tut.cpp | 558 ++++++++ linden/indra/test/lltiming_tut.cpp | 112 ++ linden/indra/test/lltut.cpp | 168 +++ linden/indra/test/lltut.h | 95 ++ linden/indra/test/lluri_tut.cpp | 221 ++++ linden/indra/test/lluserrelations_tut.cpp | 157 +++ linden/indra/test/math.cpp | 133 ++ linden/indra/test/reflection_tut.cpp | 223 ++++ linden/indra/test/test.cpp | 267 ++++ linden/indra/test/test.vcproj | 244 ++++ 24 files changed, 8449 insertions(+) create mode 100644 linden/indra/test/MacTester.xcodeproj/project.pbxproj create mode 100644 linden/indra/test/common.cpp create mode 100644 linden/indra/test/files.lst create mode 100644 linden/indra/test/inventory.cpp create mode 100644 linden/indra/test/io.cpp create mode 100644 linden/indra/test/llapp_tut.cpp create mode 100644 linden/indra/test/llhttpclient_tut.cpp create mode 100644 linden/indra/test/llhttpnode_tut.cpp create mode 100644 linden/indra/test/lliohttpserver_tut.cpp create mode 100644 linden/indra/test/llmime_tut.cpp create mode 100644 linden/indra/test/llpipeutil.cpp create mode 100644 linden/indra/test/llpipeutil.h create mode 100644 linden/indra/test/llsd_message_system_tut.cpp create mode 100644 linden/indra/test/llsd_new_tut.cpp create mode 100644 linden/indra/test/llsdserialize_tut.cpp create mode 100644 linden/indra/test/lltiming_tut.cpp create mode 100644 linden/indra/test/lltut.cpp create mode 100644 linden/indra/test/lltut.h create mode 100644 linden/indra/test/lluri_tut.cpp create mode 100644 linden/indra/test/lluserrelations_tut.cpp create mode 100644 linden/indra/test/math.cpp create mode 100644 linden/indra/test/reflection_tut.cpp create mode 100644 linden/indra/test/test.cpp create mode 100644 linden/indra/test/test.vcproj (limited to 'linden/indra/test') 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 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXAggregateTarget section */ + FD5DF9A109C0A4F5007E3F78 /* third party libs */ = { + isa = PBXAggregateTarget; + buildConfigurationList = FD5DF9A209C0A51D007E3F78 /* Build configuration list for PBXAggregateTarget "third party libs" */; + buildPhases = ( + FD5DF9A009C0A4F5007E3F78 /* ShellScript */, + ); + dependencies = ( + ); + name = "third party libs"; + productName = "third party libs"; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 386C3F070A14C85000CF4511 /* lliosocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386C3F050A14C85000CF4511 /* lliosocket.cpp */; }; + 386C3F080A14C85000CF4511 /* lliosocket.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 386C3F060A14C85000CF4511 /* lliosocket.h */; }; + 389CFB460A0B69C700EE2094 /* llfile.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 389CFB440A0B69C700EE2094 /* llfile.h */; }; + 389CFB470A0B69C700EE2094 /* llfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 389CFB450A0B69C700EE2094 /* llfile.cpp */; }; + 38A8BEAB0A18A2BC00814862 /* metaclass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38A8BEAA0A18A2BC00814862 /* metaclass.cpp */; }; + 38A8BF630A18C31D00814862 /* metaproperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38A8BF620A18C31D00814862 /* metaproperty.cpp */; }; + 38A8BF6A0A18C38800814862 /* reflective.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 38A8BF690A18C38800814862 /* reflective.h */; }; + 38A8BF750A18C42900814862 /* reflective.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38A8BF740A18C42900814862 /* reflective.cpp */; }; + 91469E810B4486F20009E8F9 /* llmime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91469E7F0B4486F20009E8F9 /* llmime.cpp */; }; + 91469E820B4486F20009E8F9 /* llmime.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 91469E800B4486F20009E8F9 /* llmime.h */; }; + 91469E840B44870B0009E8F9 /* llmime_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91469E830B44870B0009E8F9 /* llmime_tut.cpp */; }; + 91469E8D0B4489420009E8F9 /* llquaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91469E8B0B4489420009E8F9 /* llquaternion.cpp */; }; + 91469E8E0B4489420009E8F9 /* llquaternion.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 91469E8C0B4489420009E8F9 /* llquaternion.h */; }; + DA306B450ACD9E8B008D9B2F /* llsdutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B430ACD9E8B008D9B2F /* llsdutil.cpp */; }; + DA306B460ACD9E8B008D9B2F /* llstreamtools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B440ACD9E8B008D9B2F /* llstreamtools.cpp */; }; + DA306B490ACD9EBC008D9B2F /* llapp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B480ACD9EBC008D9B2F /* llapp.cpp */; }; + DA306B4E0ACD9EFD008D9B2F /* llcommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B4B0ACD9EFD008D9B2F /* llcommon.cpp */; }; + DA306B4F0ACD9EFD008D9B2F /* llerrorthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B4C0ACD9EFD008D9B2F /* llerrorthread.cpp */; }; + DA306B500ACD9EFD008D9B2F /* llrun.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B4D0ACD9EFD008D9B2F /* llrun.cpp */; }; + DA306B560ACD9F3F008D9B2F /* llapp_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B520ACD9F3F008D9B2F /* llapp_tut.cpp */; }; + DA306B570ACD9F3F008D9B2F /* llhttpclient_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B530ACD9F3F008D9B2F /* llhttpclient_tut.cpp */; }; + DA306B580ACD9F3F008D9B2F /* lltiming_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B540ACD9F3F008D9B2F /* lltiming_tut.cpp */; }; + DA306B590ACD9F3F008D9B2F /* lluri_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B550ACD9F3F008D9B2F /* lluri_tut.cpp */; }; + DA306B5C0ACD9F6F008D9B2F /* llhttpclient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B5B0ACD9F6F008D9B2F /* llhttpclient.cpp */; }; + DAD1C4CC0AE2C78C0054574C /* stats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DAD1C4CB0AE2C78C0054574C /* stats.cpp */; }; + DAD1C4DE0AE2CA0C0054574C /* llcurl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DAD1C4DD0AE2CA0C0054574C /* llcurl.cpp */; }; + FD15584D0A06BE2E00DE9AE5 /* io.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15584C0A06BE2E00DE9AE5 /* io.cpp */; }; + FD15585C0A06BEB000DE9AE5 /* llbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558500A06BEB000DE9AE5 /* llbuffer.cpp */; }; + FD15585E0A06BEB000DE9AE5 /* llbufferstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558520A06BEB000DE9AE5 /* llbufferstream.cpp */; }; + FD1558600A06BEB000DE9AE5 /* llinstantmessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558540A06BEB000DE9AE5 /* llinstantmessage.cpp */; }; + FD1558620A06BEB000DE9AE5 /* llioutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558560A06BEB000DE9AE5 /* llioutil.cpp */; }; + FD1558640A06BEB000DE9AE5 /* llsdrpcclient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558580A06BEB000DE9AE5 /* llsdrpcclient.cpp */; }; + FD1558660A06BEB000DE9AE5 /* llsdrpcserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15585A0A06BEB000DE9AE5 /* llsdrpcserver.cpp */; }; + FD15587F0A06BFAB00DE9AE5 /* llfiltersd2xmlrpc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558770A06BFAB00DE9AE5 /* llfiltersd2xmlrpc.cpp */; }; + FD1558810A06BFAB00DE9AE5 /* lliohttpserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558790A06BFAB00DE9AE5 /* lliohttpserver.cpp */; }; + FD1558830A06BFAB00DE9AE5 /* lliopipe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15587B0A06BFAB00DE9AE5 /* lliopipe.cpp */; }; + FD1558850A06BFAB00DE9AE5 /* llpumpio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15587D0A06BFAB00DE9AE5 /* llpumpio.cpp */; }; + FD15588A0A06BFE400DE9AE5 /* llchainio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558880A06BFE400DE9AE5 /* llchainio.cpp */; }; + FD15588E0A06BFF100DE9AE5 /* llmemorystream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15588C0A06BFF100DE9AE5 /* llmemorystream.cpp */; }; + FD1558930A06C01400DE9AE5 /* llframetimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558910A06C01400DE9AE5 /* llframetimer.cpp */; }; + FD1558970A06C05100DE9AE5 /* llurlrequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558950A06C05100DE9AE5 /* llurlrequest.cpp */; }; + FD15589C0A06C08A00DE9AE5 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FD15589B0A06C08A00DE9AE5 /* libcurl.dylib */; }; + FD1558A70A06C0D000DE9AE5 /* libxmlrpc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1558A60A06C0D000DE9AE5 /* libxmlrpc.a */; }; + FD1558AA0A06C14E00DE9AE5 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1558A90A06C14E00DE9AE5 /* libiconv.dylib */; }; + FD155EF40A08F0B300DE9AE5 /* m3math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155EF00A08F0B300DE9AE5 /* m3math.cpp */; }; + FD155EF60A08F0B300DE9AE5 /* m4math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155EF20A08F0B300DE9AE5 /* m4math.cpp */; }; + FD155EFA0A08F0DE00DE9AE5 /* llstringtable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155EF80A08F0DE00DE9AE5 /* llstringtable.cpp */; }; + FD155F030A08F36A00DE9AE5 /* llmemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F010A08F36A00DE9AE5 /* llmemory.cpp */; }; + FD155F0B0A08F60B00DE9AE5 /* llnullcipher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F090A08F60B00DE9AE5 /* llnullcipher.cpp */; }; + FD155F0C0A08F60B00DE9AE5 /* llxorcipher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F0A0A08F60B00DE9AE5 /* llxorcipher.cpp */; }; + FD155F100A08F63200DE9AE5 /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F0E0A08F63200DE9AE5 /* message.cpp */; }; + FD155F1F0A08F9D200DE9AE5 /* llpacketring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F1D0A08F9D200DE9AE5 /* llpacketring.cpp */; }; + FD155F240A08F9F600DE9AE5 /* v3math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F220A08F9F600DE9AE5 /* v3math.cpp */; }; + FD155F2A0A08FA0F00DE9AE5 /* llpacketbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F280A08FA0F00DE9AE5 /* llpacketbuffer.cpp */; }; + FD155F2F0A08FA9800DE9AE5 /* net.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F2D0A08FA9800DE9AE5 /* net.cpp */; }; + FD155F340A08FAD900DE9AE5 /* llxfermanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F320A08FAD900DE9AE5 /* llxfermanager.cpp */; }; + FD155F3F0A08FAF300DE9AE5 /* llxfer_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F370A08FAF300DE9AE5 /* llxfer_file.cpp */; }; + FD155F410A08FAF300DE9AE5 /* llxfer_mem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F390A08FAF300DE9AE5 /* llxfer_mem.cpp */; }; + FD155F430A08FAF300DE9AE5 /* llxfer_vfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F3B0A08FAF300DE9AE5 /* llxfer_vfile.cpp */; }; + FD155F450A08FAF300DE9AE5 /* llxfer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F3D0A08FAF300DE9AE5 /* llxfer.cpp */; }; + FD155F5D0A08FB5100DE9AE5 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD155F480A08FB5100DE9AE5 /* Carbon.framework */; }; + FD155F610A08FD5900DE9AE5 /* llfasttimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */; }; + FD155F670A08FD9100DE9AE5 /* message_string_table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F660A08FD9100DE9AE5 /* message_string_table.cpp */; }; + FD396CDD0A1D37DF005DCB1F /* lltut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD396CDC0A1D37DF005DCB1F /* lltut.cpp */; }; + FD396D160A1DFB4B005DCB1F /* reflection_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 386A940D0A0B5F60001DE10D /* reflection_tut.cpp */; }; + FD506A0609FEB58900E297C2 /* llsdserialize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD506A0409FEB58900E297C2 /* llsdserialize.cpp */; }; + FD506A2509FEB79700E297C2 /* libaprutil-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD506A2409FEB79700E297C2 /* libaprutil-1.a */; }; + FD506A2F09FEC37900E297C2 /* llsdserialize_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD506A2D09FEC37900E297C2 /* llsdserialize_tut.cpp */; }; + FD506AA909FFC70100E297C2 /* llsdserialize_xml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD506AA709FFC70100E297C2 /* llsdserialize_xml.cpp */; }; + FD506ADB09FFE09700E297C2 /* libexpat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD506ADA09FFE09700E297C2 /* libexpat.a */; }; + FD5DF87B09C0A0FB007E3F78 /* test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DF87A09C0A0FB007E3F78 /* test.cpp */; }; + FD5DF9B609C0A571007E3F78 /* libapr-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD5DF9B509C0A571007E3F78 /* libapr-1.a */; }; + FD5DF9F609C0E20E007E3F78 /* llsd_new_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DF9F409C0E20E007E3F78 /* llsd_new_tut.cpp */; }; + FD5DFA9109C1DF3E007E3F78 /* lldate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9009C1DF3E007E3F78 /* lldate.cpp */; }; + FD5DFA9309C1DF4E007E3F78 /* lluuid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9209C1DF4E007E3F78 /* lluuid.cpp */; }; + FD5DFA9909C1DFB7007E3F78 /* lluri.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9709C1DFB7007E3F78 /* lluri.cpp */; }; + FD5DFAA009C1DFE2007E3F78 /* llerrorbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9C09C1DFE2007E3F78 /* llerrorbuffer.cpp */; }; + FD5DFAA209C1DFE2007E3F78 /* llerrorstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9E09C1DFE2007E3F78 /* llerrorstream.cpp */; }; + FD5DFAA609C1E01D007E3F78 /* llmd5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAA509C1E01D007E3F78 /* llmd5.cpp */; }; + FD5DFAA909C1E056007E3F78 /* llerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAA809C1E056007E3F78 /* llerror.cpp */; }; + FD5DFAAC09C1E09F007E3F78 /* llrand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAAB09C1E09F007E3F78 /* llrand.cpp */; }; + FD5DFAAF09C1E101007E3F78 /* llapr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAAE09C1E101007E3F78 /* llapr.cpp */; }; + FD5DFAB109C1E110007E3F78 /* llstring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAB009C1E110007E3F78 /* llstring.cpp */; }; + FD5DFAB309C1E11A007E3F78 /* lltimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAB209C1E11A007E3F78 /* lltimer.cpp */; }; + FD5DFAB909C1E13A007E3F78 /* u64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAB809C1E13A007E3F78 /* u64.cpp */; }; + FD7325940A08E7A60072A37B /* common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325930A08E7A60072A37B /* common.cpp */; }; + FD7325970A08E8260072A37B /* math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325960A08E8260072A37B /* math.cpp */; }; + FD73259A0A08E8420072A37B /* inventory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325990A08E8420072A37B /* inventory.cpp */; }; + FD73259F0A08E8A00072A37B /* llinventory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD73259D0A08E8A00072A37B /* llinventory.cpp */; }; + FD7325A60A08E8F00072A37B /* llxmlnode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325A40A08E8F00072A37B /* llxmlnode.cpp */; }; + FD7325AC0A08E9330072A37B /* llpermissions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325AA0A08E9330072A37B /* llpermissions.cpp */; }; + FD7325B00A08E95F0072A37B /* llsaleinfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325AE0A08E95F0072A37B /* llsaleinfo.cpp */; }; + FD7325BF0A08EA220072A37B /* lldir_mac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325B90A08EA220072A37B /* lldir_mac.cpp */; }; + FD7325C10A08EA220072A37B /* lldir.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325BB0A08EA220072A37B /* lldir.cpp */; }; + FD7325C30A08EA220072A37B /* llvfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325BD0A08EA220072A37B /* llvfile.cpp */; }; + FD7325CA0A08EB370072A37B /* llcircuit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325C60A08EB370072A37B /* llcircuit.cpp */; }; + FD7325CC0A08EB370072A37B /* message_prehash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325C80A08EB370072A37B /* message_prehash.cpp */; }; + FD7325D30A08EB590072A37B /* llthrottle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325D10A08EB590072A37B /* llthrottle.cpp */; }; + FD7325D80A08EB6B0072A37B /* lltransfermanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325D60A08EB6B0072A37B /* lltransfermanager.cpp */; }; + FD7325E30A08EB970072A37B /* lltransfersourceasset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325DB0A08EB970072A37B /* lltransfersourceasset.cpp */; }; + FD7325E50A08EB970072A37B /* lltransfersourcefile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325DD0A08EB970072A37B /* lltransfersourcefile.cpp */; }; + FD7325E70A08EB970072A37B /* lltransfertargetfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325DF0A08EB970072A37B /* lltransfertargetfile.cpp */; }; + FD7325E90A08EB970072A37B /* lltransfertargetvfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325E10A08EB970072A37B /* lltransfertargetvfile.cpp */; }; + FD7325EE0A08EBBF0072A37B /* llqueuedthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325EC0A08EBBF0072A37B /* llqueuedthread.cpp */; }; + FD7325F20A08EBD20072A37B /* llvfsthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325F00A08EBD20072A37B /* llvfsthread.cpp */; }; + FD7325F70A08EBE40072A37B /* llvfs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325F50A08EBE40072A37B /* llvfs.cpp */; }; + FD7325FC0A08EC140072A37B /* llthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325FA0A08EC140072A37B /* llthread.cpp */; }; + FD7326030A08EC490072A37B /* llassetstorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7326010A08EC490072A37B /* llassetstorage.cpp */; }; + FD7326070A08EC5B0072A37B /* llassettype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7326050A08EC5B0072A37B /* llassettype.cpp */; }; + FD73260E0A08ECB70072A37B /* lldatapacker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD73260C0A08ECB70072A37B /* lldatapacker.cpp */; }; + FD7326130A08ECD90072A37B /* llhost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7326110A08ECD90072A37B /* llhost.cpp */; }; + FD73261C0A08ED580072A37B /* llnamevalue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD73261A0A08ED580072A37B /* llnamevalue.cpp */; }; + FD9996A30A1C15B10057C816 /* llsdhttpserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD9996A10A1C15AD0057C816 /* llsdhttpserver.cpp */; }; + FD9996D70A1CA7570057C816 /* llpipeutil.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FD9996D50A1CA7570057C816 /* llpipeutil.h */; }; + FD9996D80A1CA7570057C816 /* llpipeutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD9996D60A1CA7570057C816 /* llpipeutil.cpp */; }; + FDBC106B0AEEC3CA00ED2E62 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FD15589B0A06C08A00DE9AE5 /* libcurl.dylib */; }; + FDBC106D0AEEC3DA00ED2E62 /* llsd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DF9BE09C0A68F007E3F78 /* llsd.cpp */; }; + FDBC106F0AEEC3E900ED2E62 /* lluuid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9209C1DF4E007E3F78 /* lluuid.cpp */; }; + FDBC10710AEEC3F800ED2E62 /* llsdserialize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD506A0409FEB58900E297C2 /* llsdserialize.cpp */; }; + FDBC10720AEEC3F900ED2E62 /* llsdserialize_xml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD506AA709FFC70100E297C2 /* llsdserialize_xml.cpp */; }; + FDBC10740AEEC40F00ED2E62 /* libexpat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD506ADA09FFE09700E297C2 /* libexpat.a */; }; + FDBC10750AEEC41600ED2E62 /* lldate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9009C1DF3E007E3F78 /* lldate.cpp */; }; + FDBC10760AEEC41B00ED2E62 /* llmd5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAA509C1E01D007E3F78 /* llmd5.cpp */; }; + FDBC10790AEEC42B00ED2E62 /* llerrorstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9E09C1DFE2007E3F78 /* llerrorstream.cpp */; }; + FDBC107A0AEEC42C00ED2E62 /* llerrorbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9C09C1DFE2007E3F78 /* llerrorbuffer.cpp */; }; + FDBC107B0AEEC43200ED2E62 /* lluri.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFA9709C1DFB7007E3F78 /* lluri.cpp */; }; + FDBC107E0AEEC45100ED2E62 /* lltimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAB209C1E11A007E3F78 /* lltimer.cpp */; }; + FDBC107F0AEEC45400ED2E62 /* llfasttimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */; }; + FDBC10810AEEC46D00ED2E62 /* llapr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAAE09C1E101007E3F78 /* llapr.cpp */; }; + FDBC10830AEEC47900ED2E62 /* libapr-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD5DF9B509C0A571007E3F78 /* libapr-1.a */; }; + FDBC10840AEEC47A00ED2E62 /* libaprutil-1.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD506A2409FEB79700E297C2 /* libaprutil-1.a */; }; + FDBC10860AEEC49800ED2E62 /* lliopipe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15587B0A06BFAB00DE9AE5 /* lliopipe.cpp */; }; + FDBC10870AEEC49D00ED2E62 /* llpumpio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD15587D0A06BFAB00DE9AE5 /* llpumpio.cpp */; }; + FDBC10890AEEC4BA00ED2E62 /* llurlrequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558950A06C05100DE9AE5 /* llurlrequest.cpp */; }; + FDBC108B0AEEC4CD00ED2E62 /* llbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558500A06BEB000DE9AE5 /* llbuffer.cpp */; }; + FDBC108D0AEEC4E500ED2E62 /* llstring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAB009C1E110007E3F78 /* llstring.cpp */; }; + FDBC108F0AEEC50200ED2E62 /* u64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAB809C1E13A007E3F78 /* u64.cpp */; }; + FDBC10900AEEC50A00ED2E62 /* llmemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD155F010A08F36A00DE9AE5 /* llmemory.cpp */; }; + FDBC10990AEEC57D00ED2E62 /* llhttpclient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B5B0ACD9F6F008D9B2F /* llhttpclient.cpp */; }; + FDBC109D0AEEC5EE00ED2E62 /* llbufferstream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558520A06BEB000DE9AE5 /* llbufferstream.cpp */; }; + FDBC109F0AEEC5FB00ED2E62 /* llchainio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558880A06BFE400DE9AE5 /* llchainio.cpp */; }; + FDBC10A10AEEC60F00ED2E62 /* llioutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558560A06BEB000DE9AE5 /* llioutil.cpp */; }; + FDBC10A30AEEC62400ED2E62 /* llthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD7325FA0A08EC140072A37B /* llthread.cpp */; }; + FDBC10A50AEEC63200ED2E62 /* llerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAA809C1E056007E3F78 /* llerror.cpp */; }; + FDBC10A70AEEC64100ED2E62 /* llrand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DFAAB09C1E09F007E3F78 /* llrand.cpp */; }; + FDBC10A90AEEC65700ED2E62 /* llstreamtools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA306B440ACD9E8B008D9B2F /* llstreamtools.cpp */; }; + FDBC10AB0AEEC66100ED2E62 /* testwebclient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA01B2040ADE839D00A44198 /* testwebclient.cpp */; }; + FDBC10AD0AEEC67700ED2E62 /* llframetimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD1558910A06C01400DE9AE5 /* llframetimer.cpp */; }; + FDCB2A670AF80D9000C44EBA /* llprocessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDCB2A650AF80D9000C44EBA /* llprocessor.cpp */; }; + FDCB2A680AF80D9000C44EBA /* llprocessor.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FDCB2A660AF80D9000C44EBA /* llprocessor.h */; }; + FDEC4F5509F7EF7A007BAEEC /* llsd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD5DF9BE09C0A68F007E3F78 /* llsd.cpp */; }; + FDFAD4210AFFFCC30048A0C7 /* llhttpnode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDFAD41F0AFFFCC30048A0C7 /* llhttpnode.cpp */; }; + FDFAD4220AFFFCC30048A0C7 /* llhttpnode.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FDFAD4200AFFFCC30048A0C7 /* llhttpnode.h */; }; + FDFBED130A1B591B0056E81E /* lliohttpserver_tut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDFBED120A1B591B0056E81E /* lliohttpserver_tut.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + FD5DF9A809C0A537007E3F78 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FD5DF9A109C0A4F5007E3F78; + remoteInfo = "third party libs"; + }; + FDBC10500AEEB7C300ED2E62 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FD5DF9A109C0A4F5007E3F78; + remoteInfo = "third party libs"; + }; + FDBC10510AEEB7C300ED2E62 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FD5DF9A109C0A4F5007E3F78; + remoteInfo = "third party libs"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 8DD76F690486A84900D96B5E /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 8; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + 389CFB460A0B69C700EE2094 /* llfile.h in CopyFiles */, + 386C3F080A14C85000CF4511 /* lliosocket.h in CopyFiles */, + 38A8BF6A0A18C38800814862 /* reflective.h in CopyFiles */, + FD9996D70A1CA7570057C816 /* llpipeutil.h in CopyFiles */, + FDCB2A680AF80D9000C44EBA /* llprocessor.h in CopyFiles */, + FDFAD4220AFFFCC30048A0C7 /* llhttpnode.h in CopyFiles */, + 91469E820B4486F20009E8F9 /* llmime.h in CopyFiles */, + 91469E8E0B4489420009E8F9 /* llquaternion.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 383A14F90A1A1C6700F420F7 /* metapropertyt.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = metapropertyt.h; sourceTree = ""; }; + 386A940D0A0B5F60001DE10D /* reflection_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = reflection_tut.cpp; sourceTree = ""; }; + 386C3F050A14C85000CF4511 /* lliosocket.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lliosocket.cpp; sourceTree = ""; }; + 386C3F060A14C85000CF4511 /* lliosocket.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lliosocket.h; sourceTree = ""; }; + 389CFB440A0B69C700EE2094 /* llfile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfile.h; sourceTree = ""; }; + 389CFB450A0B69C700EE2094 /* llfile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfile.cpp; sourceTree = ""; }; + 38A8BEAA0A18A2BC00814862 /* metaclass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = metaclass.cpp; sourceTree = ""; }; + 38A8BF140A18A6FF00814862 /* metaclass.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = metaclass.h; sourceTree = ""; }; + 38A8BF620A18C31D00814862 /* metaproperty.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = metaproperty.cpp; sourceTree = ""; }; + 38A8BF690A18C38800814862 /* reflective.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = reflective.h; sourceTree = ""; }; + 38A8BF740A18C42900814862 /* reflective.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = reflective.cpp; sourceTree = ""; }; + 8DD76F6C0486A84900D96B5E /* MacTester */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = MacTester; sourceTree = BUILT_PRODUCTS_DIR; }; + 91469E7F0B4486F20009E8F9 /* llmime.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmime.cpp; sourceTree = ""; }; + 91469E800B4486F20009E8F9 /* llmime.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llmime.h; sourceTree = ""; }; + 91469E830B44870B0009E8F9 /* llmime_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmime_tut.cpp; sourceTree = ""; }; + 91469E8B0B4489420009E8F9 /* llquaternion.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llquaternion.cpp; sourceTree = ""; }; + 91469E8C0B4489420009E8F9 /* llquaternion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llquaternion.h; sourceTree = ""; }; + DA01B1EF0ADE82C400A44198 /* TestWebClient */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestWebClient; sourceTree = BUILT_PRODUCTS_DIR; }; + DA01B2040ADE839D00A44198 /* testwebclient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = testwebclient.cpp; sourceTree = ""; }; + DA306B430ACD9E8B008D9B2F /* llsdutil.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsdutil.cpp; sourceTree = ""; }; + DA306B440ACD9E8B008D9B2F /* llstreamtools.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llstreamtools.cpp; sourceTree = ""; }; + DA306B480ACD9EBC008D9B2F /* llapp.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llapp.cpp; sourceTree = ""; }; + DA306B4B0ACD9EFD008D9B2F /* llcommon.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcommon.cpp; sourceTree = ""; }; + DA306B4C0ACD9EFD008D9B2F /* llerrorthread.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerrorthread.cpp; sourceTree = ""; }; + DA306B4D0ACD9EFD008D9B2F /* llrun.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llrun.cpp; sourceTree = ""; }; + DA306B520ACD9F3F008D9B2F /* llapp_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llapp_tut.cpp; sourceTree = ""; }; + DA306B530ACD9F3F008D9B2F /* llhttpclient_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhttpclient_tut.cpp; sourceTree = ""; }; + DA306B540ACD9F3F008D9B2F /* lltiming_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltiming_tut.cpp; sourceTree = ""; }; + DA306B550ACD9F3F008D9B2F /* lluri_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluri_tut.cpp; sourceTree = ""; }; + DA306B5B0ACD9F6F008D9B2F /* llhttpclient.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhttpclient.cpp; sourceTree = ""; }; + DAD1C4CA0AE2C78C0054574C /* stats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stats.h; sourceTree = ""; }; + DAD1C4CB0AE2C78C0054574C /* stats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stats.cpp; sourceTree = ""; }; + DAD1C4DC0AE2CA0C0054574C /* llcurl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = llcurl.h; sourceTree = ""; }; + DAD1C4DD0AE2CA0C0054574C /* llcurl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llcurl.cpp; sourceTree = ""; }; + FD15584C0A06BE2E00DE9AE5 /* io.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = io.cpp; sourceTree = ""; }; + FD1558500A06BEB000DE9AE5 /* llbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llbuffer.cpp; sourceTree = ""; }; + FD1558510A06BEB000DE9AE5 /* llbuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llbuffer.h; sourceTree = ""; }; + FD1558520A06BEB000DE9AE5 /* llbufferstream.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llbufferstream.cpp; sourceTree = ""; }; + FD1558530A06BEB000DE9AE5 /* llbufferstream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llbufferstream.h; sourceTree = ""; }; + FD1558540A06BEB000DE9AE5 /* llinstantmessage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llinstantmessage.cpp; sourceTree = ""; }; + FD1558550A06BEB000DE9AE5 /* llinstantmessage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llinstantmessage.h; sourceTree = ""; }; + FD1558560A06BEB000DE9AE5 /* llioutil.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llioutil.cpp; sourceTree = ""; }; + FD1558570A06BEB000DE9AE5 /* llioutil.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llioutil.h; sourceTree = ""; }; + FD1558580A06BEB000DE9AE5 /* llsdrpcclient.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsdrpcclient.cpp; sourceTree = ""; }; + FD1558590A06BEB000DE9AE5 /* llsdrpcclient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llsdrpcclient.h; sourceTree = ""; }; + FD15585A0A06BEB000DE9AE5 /* llsdrpcserver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsdrpcserver.cpp; sourceTree = ""; }; + FD15585B0A06BEB000DE9AE5 /* llsdrpcserver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llsdrpcserver.h; sourceTree = ""; }; + FD1558770A06BFAB00DE9AE5 /* llfiltersd2xmlrpc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfiltersd2xmlrpc.cpp; sourceTree = ""; }; + FD1558780A06BFAB00DE9AE5 /* llfiltersd2xmlrpc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfiltersd2xmlrpc.h; sourceTree = ""; }; + FD1558790A06BFAB00DE9AE5 /* lliohttpserver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lliohttpserver.cpp; sourceTree = ""; }; + FD15587A0A06BFAB00DE9AE5 /* lliohttpserver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lliohttpserver.h; sourceTree = ""; }; + FD15587B0A06BFAB00DE9AE5 /* lliopipe.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lliopipe.cpp; sourceTree = ""; }; + FD15587C0A06BFAB00DE9AE5 /* lliopipe.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lliopipe.h; sourceTree = ""; }; + FD15587D0A06BFAB00DE9AE5 /* llpumpio.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpumpio.cpp; sourceTree = ""; }; + FD15587E0A06BFAB00DE9AE5 /* llpumpio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpumpio.h; sourceTree = ""; }; + FD1558880A06BFE400DE9AE5 /* llchainio.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llchainio.cpp; sourceTree = ""; }; + FD1558890A06BFE400DE9AE5 /* llchainio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llchainio.h; sourceTree = ""; }; + FD15588C0A06BFF100DE9AE5 /* llmemorystream.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmemorystream.cpp; sourceTree = ""; }; + FD15588D0A06BFF100DE9AE5 /* llmemorystream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llmemorystream.h; sourceTree = ""; }; + FD1558910A06C01400DE9AE5 /* llframetimer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llframetimer.cpp; sourceTree = ""; }; + FD1558920A06C01400DE9AE5 /* llframetimer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llframetimer.h; sourceTree = ""; }; + FD1558950A06C05100DE9AE5 /* llurlrequest.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llurlrequest.cpp; sourceTree = ""; }; + FD1558960A06C05100DE9AE5 /* llurlrequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llurlrequest.h; sourceTree = ""; }; + FD15589B0A06C08A00DE9AE5 /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = /usr/lib/libcurl.dylib; sourceTree = ""; }; + FD1558A60A06C0D000DE9AE5 /* libxmlrpc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libxmlrpc.a; path = build/Debug/libxmlrpc.a; sourceTree = ""; }; + FD1558A90A06C14E00DE9AE5 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = /usr/lib/libiconv.dylib; sourceTree = ""; }; + FD155EF00A08F0B300DE9AE5 /* m3math.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = m3math.cpp; sourceTree = ""; }; + FD155EF10A08F0B300DE9AE5 /* m3math.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = m3math.h; sourceTree = ""; }; + FD155EF20A08F0B300DE9AE5 /* m4math.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = m4math.cpp; sourceTree = ""; }; + FD155EF30A08F0B300DE9AE5 /* m4math.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = m4math.h; sourceTree = ""; }; + FD155EF80A08F0DE00DE9AE5 /* llstringtable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llstringtable.cpp; sourceTree = ""; }; + FD155EF90A08F0DE00DE9AE5 /* llstringtable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llstringtable.h; sourceTree = ""; }; + FD155F010A08F36A00DE9AE5 /* llmemory.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmemory.cpp; sourceTree = ""; }; + FD155F020A08F36A00DE9AE5 /* llmemory.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llmemory.h; sourceTree = ""; }; + FD155F050A08F37900DE9AE5 /* llcrypto.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcrypto.h; sourceTree = ""; }; + FD155F090A08F60B00DE9AE5 /* llnullcipher.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llnullcipher.cpp; sourceTree = ""; }; + FD155F0A0A08F60B00DE9AE5 /* llxorcipher.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxorcipher.cpp; sourceTree = ""; }; + FD155F0E0A08F63200DE9AE5 /* message.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = message.cpp; sourceTree = ""; }; + FD155F1D0A08F9D200DE9AE5 /* llpacketring.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpacketring.cpp; sourceTree = ""; }; + FD155F1E0A08F9D200DE9AE5 /* llpacketring.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpacketring.h; sourceTree = ""; }; + FD155F220A08F9F600DE9AE5 /* v3math.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = v3math.cpp; sourceTree = ""; }; + FD155F230A08F9F600DE9AE5 /* v3math.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = v3math.h; sourceTree = ""; }; + FD155F280A08FA0F00DE9AE5 /* llpacketbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpacketbuffer.cpp; sourceTree = ""; }; + FD155F290A08FA0F00DE9AE5 /* llpacketbuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpacketbuffer.h; sourceTree = ""; }; + FD155F2D0A08FA9800DE9AE5 /* net.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = net.cpp; sourceTree = ""; }; + FD155F2E0A08FA9800DE9AE5 /* net.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = net.h; sourceTree = ""; }; + FD155F320A08FAD900DE9AE5 /* llxfermanager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxfermanager.cpp; sourceTree = ""; }; + FD155F330A08FAD900DE9AE5 /* llxfermanager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxfermanager.h; sourceTree = ""; }; + FD155F370A08FAF300DE9AE5 /* llxfer_file.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxfer_file.cpp; sourceTree = ""; }; + FD155F380A08FAF300DE9AE5 /* llxfer_file.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxfer_file.h; sourceTree = ""; }; + FD155F390A08FAF300DE9AE5 /* llxfer_mem.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxfer_mem.cpp; sourceTree = ""; }; + FD155F3A0A08FAF300DE9AE5 /* llxfer_mem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxfer_mem.h; sourceTree = ""; }; + FD155F3B0A08FAF300DE9AE5 /* llxfer_vfile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxfer_vfile.cpp; sourceTree = ""; }; + FD155F3C0A08FAF300DE9AE5 /* llxfer_vfile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxfer_vfile.h; sourceTree = ""; }; + FD155F3D0A08FAF300DE9AE5 /* llxfer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxfer.cpp; sourceTree = ""; }; + FD155F3E0A08FAF300DE9AE5 /* llxfer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxfer.h; sourceTree = ""; }; + FD155F480A08FB5100DE9AE5 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; + FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfasttimer.cpp; sourceTree = ""; }; + FD155F600A08FD5900DE9AE5 /* llfasttimer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfasttimer.h; sourceTree = ""; }; + FD155F660A08FD9100DE9AE5 /* message_string_table.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = message_string_table.cpp; sourceTree = ""; }; + FD396CD80A1D3768005DCB1F /* lltut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltut.h; sourceTree = ""; }; + FD396CDC0A1D37DF005DCB1F /* lltut.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lltut.cpp; sourceTree = ""; }; + FD506A0409FEB58900E297C2 /* llsdserialize.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsdserialize.cpp; sourceTree = ""; }; + FD506A0509FEB58900E297C2 /* llsdserialize.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llsdserialize.h; sourceTree = ""; }; + FD506A2409FEB79700E297C2 /* libaprutil-1.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libaprutil-1.a"; path = "build/Debug/libaprutil-1.a"; sourceTree = ""; }; + FD506A2D09FEC37900E297C2 /* llsdserialize_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llsdserialize_tut.cpp; sourceTree = ""; }; + FD506AA609FFC70100E297C2 /* llsdserialize_xml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = llsdserialize_xml.h; sourceTree = ""; }; + FD506AA709FFC70100E297C2 /* llsdserialize_xml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llsdserialize_xml.cpp; sourceTree = ""; }; + FD506ADA09FFE09700E297C2 /* libexpat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexpat.a; path = build/Debug/libexpat.a; sourceTree = ""; }; + FD5DF87A09C0A0FB007E3F78 /* test.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test.cpp; sourceTree = ""; }; + FD5DF88609C0A196007E3F78 /* linden_common.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = linden_common.h; sourceTree = ""; }; + FD5DF9B509C0A571007E3F78 /* libapr-1.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libapr-1.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + FD5DF9BE09C0A68F007E3F78 /* llsd.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsd.cpp; sourceTree = ""; }; + FD5DF9BF09C0A68F007E3F78 /* llsd.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llsd.h; sourceTree = ""; }; + FD5DF9F409C0E20E007E3F78 /* llsd_new_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llsd_new_tut.cpp; sourceTree = ""; }; + FD5DFA9009C1DF3E007E3F78 /* lldate.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldate.cpp; sourceTree = ""; }; + FD5DFA9209C1DF4E007E3F78 /* lluuid.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluuid.cpp; sourceTree = ""; }; + FD5DFA9709C1DFB7007E3F78 /* lluri.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lluri.cpp; sourceTree = ""; }; + FD5DFA9C09C1DFE2007E3F78 /* llerrorbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerrorbuffer.cpp; sourceTree = ""; }; + FD5DFA9E09C1DFE2007E3F78 /* llerrorstream.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerrorstream.cpp; sourceTree = ""; }; + FD5DFAA509C1E01D007E3F78 /* llmd5.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmd5.cpp; sourceTree = ""; }; + FD5DFAA809C1E056007E3F78 /* llerror.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llerror.cpp; sourceTree = ""; }; + FD5DFAAB09C1E09F007E3F78 /* llrand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llrand.cpp; sourceTree = ""; }; + FD5DFAAE09C1E101007E3F78 /* llapr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llapr.cpp; sourceTree = ""; }; + FD5DFAB009C1E110007E3F78 /* llstring.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llstring.cpp; sourceTree = ""; }; + FD5DFAB209C1E11A007E3F78 /* lltimer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltimer.cpp; sourceTree = ""; }; + FD5DFAB809C1E13A007E3F78 /* u64.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = u64.cpp; sourceTree = ""; }; + FD7325790A0834080072A37B /* llapr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llapr.h; sourceTree = ""; }; + FD73257A0A0834080072A37B /* lldate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldate.h; sourceTree = ""; }; + FD73257B0A0834080072A37B /* llerror.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llerror.h; sourceTree = ""; }; + FD73257C0A0834080072A37B /* llerrorbuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llerrorbuffer.h; sourceTree = ""; }; + FD73257D0A0834080072A37B /* llstring.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llstring.h; sourceTree = ""; }; + FD73257E0A0834080072A37B /* lltimer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltimer.h; sourceTree = ""; }; + FD73257F0A0834080072A37B /* lluri.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lluri.h; sourceTree = ""; }; + FD7325800A0834080072A37B /* u64.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = u64.h; sourceTree = ""; }; + FD7325930A08E7A60072A37B /* common.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = common.cpp; sourceTree = ""; }; + FD7325960A08E8260072A37B /* math.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = math.cpp; sourceTree = ""; }; + FD7325990A08E8420072A37B /* inventory.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = inventory.cpp; sourceTree = ""; }; + FD73259D0A08E8A00072A37B /* llinventory.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llinventory.cpp; sourceTree = ""; }; + FD73259E0A08E8A00072A37B /* llinventory.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llinventory.h; sourceTree = ""; }; + FD7325A40A08E8F00072A37B /* llxmlnode.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxmlnode.cpp; sourceTree = ""; }; + FD7325A50A08E8F00072A37B /* llxmlnode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxmlnode.h; sourceTree = ""; }; + FD7325AA0A08E9330072A37B /* llpermissions.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpermissions.cpp; sourceTree = ""; }; + FD7325AB0A08E9330072A37B /* llpermissions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpermissions.h; sourceTree = ""; }; + FD7325AE0A08E95F0072A37B /* llsaleinfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsaleinfo.cpp; sourceTree = ""; }; + FD7325AF0A08E95F0072A37B /* llsaleinfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llsaleinfo.h; sourceTree = ""; }; + FD7325B30A08E9B10072A37B /* message.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = message.cpp; sourceTree = ""; }; + FD7325B40A08E9B10072A37B /* message.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = message.h; sourceTree = ""; }; + FD7325B90A08EA220072A37B /* lldir_mac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldir_mac.cpp; sourceTree = ""; }; + FD7325BA0A08EA220072A37B /* lldir_mac.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldir_mac.h; sourceTree = ""; }; + FD7325BB0A08EA220072A37B /* lldir.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldir.cpp; sourceTree = ""; }; + FD7325BC0A08EA220072A37B /* lldir.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldir.h; sourceTree = ""; }; + FD7325BD0A08EA220072A37B /* llvfile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvfile.cpp; sourceTree = ""; }; + FD7325BE0A08EA220072A37B /* llvfile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvfile.h; sourceTree = ""; }; + FD7325C60A08EB370072A37B /* llcircuit.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcircuit.cpp; sourceTree = ""; }; + FD7325C70A08EB370072A37B /* llcircuit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcircuit.h; sourceTree = ""; }; + FD7325C80A08EB370072A37B /* message_prehash.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = message_prehash.cpp; sourceTree = ""; }; + FD7325C90A08EB370072A37B /* message_prehash.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = message_prehash.h; sourceTree = ""; }; + FD7325D10A08EB590072A37B /* llthrottle.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llthrottle.cpp; sourceTree = ""; }; + FD7325D20A08EB590072A37B /* llthrottle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llthrottle.h; sourceTree = ""; }; + FD7325D60A08EB6B0072A37B /* lltransfermanager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltransfermanager.cpp; sourceTree = ""; }; + FD7325D70A08EB6B0072A37B /* lltransfermanager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltransfermanager.h; sourceTree = ""; }; + FD7325DB0A08EB970072A37B /* lltransfersourceasset.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltransfersourceasset.cpp; sourceTree = ""; }; + FD7325DC0A08EB970072A37B /* lltransfersourceasset.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltransfersourceasset.h; sourceTree = ""; }; + FD7325DD0A08EB970072A37B /* lltransfersourcefile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltransfersourcefile.cpp; sourceTree = ""; }; + FD7325DE0A08EB970072A37B /* lltransfersourcefile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltransfersourcefile.h; sourceTree = ""; }; + FD7325DF0A08EB970072A37B /* lltransfertargetfile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltransfertargetfile.cpp; sourceTree = ""; }; + FD7325E00A08EB970072A37B /* lltransfertargetfile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltransfertargetfile.h; sourceTree = ""; }; + FD7325E10A08EB970072A37B /* lltransfertargetvfile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltransfertargetvfile.cpp; sourceTree = ""; }; + FD7325E20A08EB970072A37B /* lltransfertargetvfile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltransfertargetvfile.h; sourceTree = ""; }; + FD7325EC0A08EBBF0072A37B /* llqueuedthread.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llqueuedthread.cpp; sourceTree = ""; }; + FD7325ED0A08EBBF0072A37B /* llqueuedthread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llqueuedthread.h; sourceTree = ""; }; + FD7325F00A08EBD20072A37B /* llvfsthread.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvfsthread.cpp; sourceTree = ""; }; + FD7325F10A08EBD20072A37B /* llvfsthread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvfsthread.h; sourceTree = ""; }; + FD7325F50A08EBE40072A37B /* llvfs.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvfs.cpp; sourceTree = ""; }; + FD7325F60A08EBE40072A37B /* llvfs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvfs.h; sourceTree = ""; }; + FD7325FA0A08EC140072A37B /* llthread.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llthread.cpp; sourceTree = ""; }; + FD7325FB0A08EC140072A37B /* llthread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llthread.h; sourceTree = ""; }; + FD7326010A08EC490072A37B /* llassetstorage.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llassetstorage.cpp; sourceTree = ""; }; + FD7326020A08EC490072A37B /* llassetstorage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llassetstorage.h; sourceTree = ""; }; + FD7326050A08EC5B0072A37B /* llassettype.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llassettype.cpp; sourceTree = ""; }; + FD7326060A08EC5B0072A37B /* llassettype.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llassettype.h; sourceTree = ""; }; + FD73260C0A08ECB70072A37B /* lldatapacker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldatapacker.cpp; sourceTree = ""; }; + FD73260D0A08ECB70072A37B /* lldatapacker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldatapacker.h; sourceTree = ""; }; + FD7326110A08ECD90072A37B /* llhost.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhost.cpp; sourceTree = ""; }; + FD7326120A08ECD90072A37B /* llhost.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llhost.h; sourceTree = ""; }; + FD73261A0A08ED580072A37B /* llnamevalue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llnamevalue.cpp; sourceTree = ""; }; + FD73261B0A08ED580072A37B /* llnamevalue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llnamevalue.h; sourceTree = ""; }; + FD7326220A08ED980072A37B /* llrand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llrand.h; sourceTree = ""; }; + FD7326230A08ED980072A37B /* lluuid.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lluuid.h; sourceTree = ""; }; + FD7326260A08EDA60072A37B /* llmd5.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llmd5.h; sourceTree = ""; }; + FD9996A10A1C15AD0057C816 /* llsdhttpserver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llsdhttpserver.cpp; sourceTree = ""; }; + FD9996A20A1C15AD0057C816 /* llsdhttpserver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llsdhttpserver.h; sourceTree = ""; }; + FD9996D50A1CA7570057C816 /* llpipeutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = llpipeutil.h; sourceTree = ""; }; + FD9996D60A1CA7570057C816 /* llpipeutil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llpipeutil.cpp; sourceTree = ""; }; + FDBC105C0AEEC30000ED2E62 /* llhttpclient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llhttpclient.h; sourceTree = ""; }; + FDBC105F0AEEC33000ED2E62 /* llskipmap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llskipmap.h; sourceTree = ""; }; + FDBC10620AEEC39000ED2E62 /* lldefs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldefs.h; sourceTree = ""; }; + FDBC10630AEEC39000ED2E62 /* stdenums.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stdenums.h; sourceTree = ""; }; + FDBC10640AEEC39000ED2E62 /* string_table.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = string_table.h; sourceTree = ""; }; + FDBC10660AEEC3A600ED2E62 /* llpriqueuemap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llpriqueuemap.h; sourceTree = ""; }; + FDCB2A650AF80D9000C44EBA /* llprocessor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llprocessor.cpp; sourceTree = ""; }; + FDCB2A660AF80D9000C44EBA /* llprocessor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llprocessor.h; sourceTree = ""; }; + FDF2E4180ADD7B620003B83E /* TestWebServer */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestWebServer; sourceTree = BUILT_PRODUCTS_DIR; }; + FDF2E5580ADDBB7F0003B83E /* llhttpdelayeddata.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhttpdelayeddata.cpp; sourceTree = ""; }; + FDF2E5590ADDBB7F0003B83E /* llhttpdelayeddata.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llhttpdelayeddata.h; sourceTree = ""; }; + FDF2E55A0ADDBB7F0003B83E /* llwebserver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llwebserver.cpp; sourceTree = ""; }; + FDF2E55B0ADDBB7F0003B83E /* llwebserver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llwebserver.h; sourceTree = ""; }; + FDF2E55C0ADDBB7F0003B83E /* testwebserver.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = testwebserver.cpp; sourceTree = ""; }; + FDFAD41F0AFFFCC30048A0C7 /* llhttpnode.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhttpnode.cpp; sourceTree = ""; }; + FDFAD4200AFFFCC30048A0C7 /* llhttpnode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llhttpnode.h; sourceTree = ""; }; + FDFBED120A1B591B0056E81E /* lliohttpserver_tut.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lliohttpserver_tut.cpp; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8DD76F660486A84900D96B5E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FD5DF9B609C0A571007E3F78 /* libapr-1.a in Frameworks */, + FD506A2509FEB79700E297C2 /* libaprutil-1.a in Frameworks */, + FD506ADB09FFE09700E297C2 /* libexpat.a in Frameworks */, + FD15589C0A06C08A00DE9AE5 /* libcurl.dylib in Frameworks */, + FD1558A70A06C0D000DE9AE5 /* libxmlrpc.a in Frameworks */, + FD1558AA0A06C14E00DE9AE5 /* libiconv.dylib in Frameworks */, + FD155F5D0A08FB5100DE9AE5 /* Carbon.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DA01B1E80ADE82C400A44198 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBC106B0AEEC3CA00ED2E62 /* libcurl.dylib in Frameworks */, + FDBC10740AEEC40F00ED2E62 /* libexpat.a in Frameworks */, + FDBC10830AEEC47900ED2E62 /* libapr-1.a in Frameworks */, + FDBC10840AEEC47A00ED2E62 /* libaprutil-1.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDF2E4160ADD7B620003B83E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 08FB7794FE84155DC02AAC07 /* MacTester */ = { + isa = PBXGroup; + children = ( + FD5DF88009C0A17D007E3F78 /* llcommon */, + FD73259C0A08E8520072A37B /* llinventory */, + FD5DF9CD09C0A72C007E3F78 /* llmath */, + FD15584F0A06BE4100DE9AE5 /* llmessage */, + FD7325B80A08E9FC0072A37B /* llvfs */, + FD7325A80A08E8F50072A37B /* llxml */, + 08FB7795FE84155DC02AAC07 /* test */, + FD15589A0A06C07A00DE9AE5 /* System Libraries */, + FD5DF9B309C0A550007E3F78 /* Third Party Libs */, + 1AB674ADFE9D54B511CA2CBB /* Products */, + ); + name = MacTester; + sourceTree = ""; + }; + 08FB7795FE84155DC02AAC07 /* test */ = { + isa = PBXGroup; + children = ( + DA01B1F10ADE831200A44198 /* testwebclient */, + FDF2E5600ADDBB900003B83E /* testwebserver */, + 91469E830B44870B0009E8F9 /* llmime_tut.cpp */, + DA306B520ACD9F3F008D9B2F /* llapp_tut.cpp */, + DA306B530ACD9F3F008D9B2F /* llhttpclient_tut.cpp */, + DA306B540ACD9F3F008D9B2F /* lltiming_tut.cpp */, + DA306B550ACD9F3F008D9B2F /* lluri_tut.cpp */, + 386A940D0A0B5F60001DE10D /* reflection_tut.cpp */, + FD7325930A08E7A60072A37B /* common.cpp */, + FD7325990A08E8420072A37B /* inventory.cpp */, + FD15584C0A06BE2E00DE9AE5 /* io.cpp */, + FD5DF9F409C0E20E007E3F78 /* llsd_new_tut.cpp */, + FD506A2D09FEC37900E297C2 /* llsdserialize_tut.cpp */, + FD7325960A08E8260072A37B /* math.cpp */, + FD5DF87A09C0A0FB007E3F78 /* test.cpp */, + FDFBED120A1B591B0056E81E /* lliohttpserver_tut.cpp */, + FD9996D50A1CA7570057C816 /* llpipeutil.h */, + FD9996D60A1CA7570057C816 /* llpipeutil.cpp */, + FD396CD80A1D3768005DCB1F /* lltut.h */, + FD396CDC0A1D37DF005DCB1F /* lltut.cpp */, + ); + name = test; + sourceTree = ""; + }; + 1AB674ADFE9D54B511CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8DD76F6C0486A84900D96B5E /* MacTester */, + FDF2E4180ADD7B620003B83E /* TestWebServer */, + DA01B1EF0ADE82C400A44198 /* TestWebClient */, + ); + name = Products; + sourceTree = ""; + }; + DA01B1F10ADE831200A44198 /* testwebclient */ = { + isa = PBXGroup; + children = ( + DA01B2040ADE839D00A44198 /* testwebclient.cpp */, + DAD1C4CA0AE2C78C0054574C /* stats.h */, + DAD1C4CB0AE2C78C0054574C /* stats.cpp */, + DAD1C4DC0AE2CA0C0054574C /* llcurl.h */, + DAD1C4DD0AE2CA0C0054574C /* llcurl.cpp */, + ); + path = testwebclient; + sourceTree = ""; + }; + FD15584F0A06BE4100DE9AE5 /* llmessage */ = { + isa = PBXGroup; + children = ( + 91469E7F0B4486F20009E8F9 /* llmime.cpp */, + 91469E800B4486F20009E8F9 /* llmime.h */, + FDFAD41F0AFFFCC30048A0C7 /* llhttpnode.cpp */, + FDFAD4200AFFFCC30048A0C7 /* llhttpnode.h */, + FDBC105C0AEEC30000ED2E62 /* llhttpclient.h */, + DA306B5B0ACD9F6F008D9B2F /* llhttpclient.cpp */, + FD9996A10A1C15AD0057C816 /* llsdhttpserver.cpp */, + FD9996A20A1C15AD0057C816 /* llsdhttpserver.h */, + 386C3F050A14C85000CF4511 /* lliosocket.cpp */, + 386C3F060A14C85000CF4511 /* lliosocket.h */, + FD7326010A08EC490072A37B /* llassetstorage.cpp */, + FD7326020A08EC490072A37B /* llassetstorage.h */, + FD1558500A06BEB000DE9AE5 /* llbuffer.cpp */, + FD1558510A06BEB000DE9AE5 /* llbuffer.h */, + FD1558520A06BEB000DE9AE5 /* llbufferstream.cpp */, + FD1558530A06BEB000DE9AE5 /* llbufferstream.h */, + FD1558880A06BFE400DE9AE5 /* llchainio.cpp */, + FD1558890A06BFE400DE9AE5 /* llchainio.h */, + FD7325C60A08EB370072A37B /* llcircuit.cpp */, + FD7325C70A08EB370072A37B /* llcircuit.h */, + FD155F050A08F37900DE9AE5 /* llcrypto.h */, + FD73260C0A08ECB70072A37B /* lldatapacker.cpp */, + FD73260D0A08ECB70072A37B /* lldatapacker.h */, + FD1558770A06BFAB00DE9AE5 /* llfiltersd2xmlrpc.cpp */, + FD1558780A06BFAB00DE9AE5 /* llfiltersd2xmlrpc.h */, + FD7326110A08ECD90072A37B /* llhost.cpp */, + FD7326120A08ECD90072A37B /* llhost.h */, + FD1558540A06BEB000DE9AE5 /* llinstantmessage.cpp */, + FD1558550A06BEB000DE9AE5 /* llinstantmessage.h */, + FD1558790A06BFAB00DE9AE5 /* lliohttpserver.cpp */, + FD15587A0A06BFAB00DE9AE5 /* lliohttpserver.h */, + FD15587B0A06BFAB00DE9AE5 /* lliopipe.cpp */, + FD15587C0A06BFAB00DE9AE5 /* lliopipe.h */, + FD1558560A06BEB000DE9AE5 /* llioutil.cpp */, + FD1558570A06BEB000DE9AE5 /* llioutil.h */, + FD73261A0A08ED580072A37B /* llnamevalue.cpp */, + FD73261B0A08ED580072A37B /* llnamevalue.h */, + FD155F090A08F60B00DE9AE5 /* llnullcipher.cpp */, + FD155F280A08FA0F00DE9AE5 /* llpacketbuffer.cpp */, + FD155F290A08FA0F00DE9AE5 /* llpacketbuffer.h */, + FD155F1D0A08F9D200DE9AE5 /* llpacketring.cpp */, + FD155F1E0A08F9D200DE9AE5 /* llpacketring.h */, + FD15587D0A06BFAB00DE9AE5 /* llpumpio.cpp */, + FD15587E0A06BFAB00DE9AE5 /* llpumpio.h */, + FD1558580A06BEB000DE9AE5 /* llsdrpcclient.cpp */, + FD1558590A06BEB000DE9AE5 /* llsdrpcclient.h */, + FD15585A0A06BEB000DE9AE5 /* llsdrpcserver.cpp */, + FD15585B0A06BEB000DE9AE5 /* llsdrpcserver.h */, + FD7325D10A08EB590072A37B /* llthrottle.cpp */, + FD7325D20A08EB590072A37B /* llthrottle.h */, + FD7325D60A08EB6B0072A37B /* lltransfermanager.cpp */, + FD7325D70A08EB6B0072A37B /* lltransfermanager.h */, + FD7325DB0A08EB970072A37B /* lltransfersourceasset.cpp */, + FD7325DC0A08EB970072A37B /* lltransfersourceasset.h */, + FD7325DD0A08EB970072A37B /* lltransfersourcefile.cpp */, + FD7325DE0A08EB970072A37B /* lltransfersourcefile.h */, + FD7325DF0A08EB970072A37B /* lltransfertargetfile.cpp */, + FD7325E00A08EB970072A37B /* lltransfertargetfile.h */, + FD7325E10A08EB970072A37B /* lltransfertargetvfile.cpp */, + FD7325E20A08EB970072A37B /* lltransfertargetvfile.h */, + FD1558950A06C05100DE9AE5 /* llurlrequest.cpp */, + FD1558960A06C05100DE9AE5 /* llurlrequest.h */, + FD155F3D0A08FAF300DE9AE5 /* llxfer.cpp */, + FD155F3E0A08FAF300DE9AE5 /* llxfer.h */, + FD155F370A08FAF300DE9AE5 /* llxfer_file.cpp */, + FD155F380A08FAF300DE9AE5 /* llxfer_file.h */, + FD155F390A08FAF300DE9AE5 /* llxfer_mem.cpp */, + FD155F3A0A08FAF300DE9AE5 /* llxfer_mem.h */, + FD155F3B0A08FAF300DE9AE5 /* llxfer_vfile.cpp */, + FD155F3C0A08FAF300DE9AE5 /* llxfer_vfile.h */, + FD155F320A08FAD900DE9AE5 /* llxfermanager.cpp */, + FD155F330A08FAD900DE9AE5 /* llxfermanager.h */, + FD155F0A0A08F60B00DE9AE5 /* llxorcipher.cpp */, + FD155F0E0A08F63200DE9AE5 /* message.cpp */, + FD7325B40A08E9B10072A37B /* message.h */, + FD7325C80A08EB370072A37B /* message_prehash.cpp */, + FD7325C90A08EB370072A37B /* message_prehash.h */, + FD155F660A08FD9100DE9AE5 /* message_string_table.cpp */, + FD155F2D0A08FA9800DE9AE5 /* net.cpp */, + FD155F2E0A08FA9800DE9AE5 /* net.h */, + FD7325B30A08E9B10072A37B /* message.cpp */, + FD7325B40A08E9B10072A37B /* message.h */, + ); + name = llmessage; + path = ../llmessage; + sourceTree = ""; + }; + FD15589A0A06C07A00DE9AE5 /* System Libraries */ = { + isa = PBXGroup; + children = ( + FD155F480A08FB5100DE9AE5 /* Carbon.framework */, + FD1558A90A06C14E00DE9AE5 /* libiconv.dylib */, + FD15589B0A06C08A00DE9AE5 /* libcurl.dylib */, + ); + name = "System Libraries"; + sourceTree = ""; + }; + FD5DF88009C0A17D007E3F78 /* llcommon */ = { + isa = PBXGroup; + children = ( + FDCB2A650AF80D9000C44EBA /* llprocessor.cpp */, + FDCB2A660AF80D9000C44EBA /* llprocessor.h */, + FDBC10660AEEC3A600ED2E62 /* llpriqueuemap.h */, + FDBC10620AEEC39000ED2E62 /* lldefs.h */, + FDBC10630AEEC39000ED2E62 /* stdenums.h */, + FDBC10640AEEC39000ED2E62 /* string_table.h */, + FDBC105F0AEEC33000ED2E62 /* llskipmap.h */, + DA306B4B0ACD9EFD008D9B2F /* llcommon.cpp */, + DA306B4C0ACD9EFD008D9B2F /* llerrorthread.cpp */, + DA306B4D0ACD9EFD008D9B2F /* llrun.cpp */, + DA306B480ACD9EBC008D9B2F /* llapp.cpp */, + DA306B430ACD9E8B008D9B2F /* llsdutil.cpp */, + DA306B440ACD9E8B008D9B2F /* llstreamtools.cpp */, + FD5DF88609C0A196007E3F78 /* linden_common.h */, + FD5DFAAE09C1E101007E3F78 /* llapr.cpp */, + FD7325790A0834080072A37B /* llapr.h */, + FD7326050A08EC5B0072A37B /* llassettype.cpp */, + FD7326060A08EC5B0072A37B /* llassettype.h */, + FD5DFA9009C1DF3E007E3F78 /* lldate.cpp */, + FD73257A0A0834080072A37B /* lldate.h */, + FD5DFAA809C1E056007E3F78 /* llerror.cpp */, + FD73257B0A0834080072A37B /* llerror.h */, + FD5DFA9C09C1DFE2007E3F78 /* llerrorbuffer.cpp */, + FD73257C0A0834080072A37B /* llerrorbuffer.h */, + FD5DFA9E09C1DFE2007E3F78 /* llerrorstream.cpp */, + FD155F5F0A08FD5900DE9AE5 /* llfasttimer.cpp */, + FD155F600A08FD5900DE9AE5 /* llfasttimer.h */, + 389CFB450A0B69C700EE2094 /* llfile.cpp */, + 389CFB440A0B69C700EE2094 /* llfile.h */, + FD1558910A06C01400DE9AE5 /* llframetimer.cpp */, + FD1558920A06C01400DE9AE5 /* llframetimer.h */, + FD155F010A08F36A00DE9AE5 /* llmemory.cpp */, + FD155F020A08F36A00DE9AE5 /* llmemory.h */, + FD15588C0A06BFF100DE9AE5 /* llmemorystream.cpp */, + FD15588D0A06BFF100DE9AE5 /* llmemorystream.h */, + FD7325EC0A08EBBF0072A37B /* llqueuedthread.cpp */, + FD7325ED0A08EBBF0072A37B /* llqueuedthread.h */, + FD5DF9BE09C0A68F007E3F78 /* llsd.cpp */, + FD5DF9BF09C0A68F007E3F78 /* llsd.h */, + FD506A0409FEB58900E297C2 /* llsdserialize.cpp */, + FD506A0509FEB58900E297C2 /* llsdserialize.h */, + FD506AA709FFC70100E297C2 /* llsdserialize_xml.cpp */, + FD506AA609FFC70100E297C2 /* llsdserialize_xml.h */, + FD5DFAB009C1E110007E3F78 /* llstring.cpp */, + FD73257D0A0834080072A37B /* llstring.h */, + FD155EF80A08F0DE00DE9AE5 /* llstringtable.cpp */, + FD155EF90A08F0DE00DE9AE5 /* llstringtable.h */, + FD7325FA0A08EC140072A37B /* llthread.cpp */, + FD7325FB0A08EC140072A37B /* llthread.h */, + FD5DFAB209C1E11A007E3F78 /* lltimer.cpp */, + FD73257E0A0834080072A37B /* lltimer.h */, + FD5DFA9709C1DFB7007E3F78 /* lluri.cpp */, + FD73257F0A0834080072A37B /* lluri.h */, + 38A8BEAA0A18A2BC00814862 /* metaclass.cpp */, + 38A8BF140A18A6FF00814862 /* metaclass.h */, + 38A8BF620A18C31D00814862 /* metaproperty.cpp */, + 383A14F90A1A1C6700F420F7 /* metapropertyt.h */, + 38A8BF740A18C42900814862 /* reflective.cpp */, + 38A8BF690A18C38800814862 /* reflective.h */, + FD5DFAB809C1E13A007E3F78 /* u64.cpp */, + FD7325800A0834080072A37B /* u64.h */, + ); + name = llcommon; + path = ../llcommon; + sourceTree = SOURCE_ROOT; + }; + FD5DF9B309C0A550007E3F78 /* Third Party Libs */ = { + isa = PBXGroup; + children = ( + FD1558A60A06C0D000DE9AE5 /* libxmlrpc.a */, + FD506ADA09FFE09700E297C2 /* libexpat.a */, + FD506A2409FEB79700E297C2 /* libaprutil-1.a */, + FD5DF9B509C0A571007E3F78 /* libapr-1.a */, + ); + name = "Third Party Libs"; + sourceTree = ""; + }; + FD5DF9CD09C0A72C007E3F78 /* llmath */ = { + isa = PBXGroup; + children = ( + 91469E8B0B4489420009E8F9 /* llquaternion.cpp */, + 91469E8C0B4489420009E8F9 /* llquaternion.h */, + FD5DFAA509C1E01D007E3F78 /* llmd5.cpp */, + FD7326260A08EDA60072A37B /* llmd5.h */, + FD5DFAAB09C1E09F007E3F78 /* llrand.cpp */, + FD7326220A08ED980072A37B /* llrand.h */, + FD5DFA9209C1DF4E007E3F78 /* lluuid.cpp */, + FD7326230A08ED980072A37B /* lluuid.h */, + FD155EF00A08F0B300DE9AE5 /* m3math.cpp */, + FD155EF10A08F0B300DE9AE5 /* m3math.h */, + FD155EF20A08F0B300DE9AE5 /* m4math.cpp */, + FD155EF30A08F0B300DE9AE5 /* m4math.h */, + FD155F220A08F9F600DE9AE5 /* v3math.cpp */, + FD155F230A08F9F600DE9AE5 /* v3math.h */, + ); + name = llmath; + path = ../llmath; + sourceTree = SOURCE_ROOT; + }; + FD73259C0A08E8520072A37B /* llinventory */ = { + isa = PBXGroup; + children = ( + FD73259D0A08E8A00072A37B /* llinventory.cpp */, + FD73259E0A08E8A00072A37B /* llinventory.h */, + FD7325AA0A08E9330072A37B /* llpermissions.cpp */, + FD7325AB0A08E9330072A37B /* llpermissions.h */, + FD7325AE0A08E95F0072A37B /* llsaleinfo.cpp */, + FD7325AF0A08E95F0072A37B /* llsaleinfo.h */, + ); + name = llinventory; + path = ../llinventory; + sourceTree = ""; + }; + FD7325A80A08E8F50072A37B /* llxml */ = { + isa = PBXGroup; + children = ( + FD7325A40A08E8F00072A37B /* llxmlnode.cpp */, + FD7325A50A08E8F00072A37B /* llxmlnode.h */, + ); + name = llxml; + path = ../llxml; + sourceTree = ""; + }; + FD7325B80A08E9FC0072A37B /* llvfs */ = { + isa = PBXGroup; + children = ( + FD7325BB0A08EA220072A37B /* lldir.cpp */, + FD7325BC0A08EA220072A37B /* lldir.h */, + FD7325B90A08EA220072A37B /* lldir_mac.cpp */, + FD7325BA0A08EA220072A37B /* lldir_mac.h */, + FD7325BD0A08EA220072A37B /* llvfile.cpp */, + FD7325BE0A08EA220072A37B /* llvfile.h */, + FD7325F50A08EBE40072A37B /* llvfs.cpp */, + FD7325F60A08EBE40072A37B /* llvfs.h */, + FD7325F00A08EBD20072A37B /* llvfsthread.cpp */, + FD7325F10A08EBD20072A37B /* llvfsthread.h */, + ); + name = llvfs; + path = ../llvfs; + sourceTree = ""; + }; + FDF2E5600ADDBB900003B83E /* testwebserver */ = { + isa = PBXGroup; + children = ( + FDF2E5580ADDBB7F0003B83E /* llhttpdelayeddata.cpp */, + FDF2E5590ADDBB7F0003B83E /* llhttpdelayeddata.h */, + FDF2E55A0ADDBB7F0003B83E /* llwebserver.cpp */, + FDF2E55B0ADDBB7F0003B83E /* llwebserver.h */, + FDF2E55C0ADDBB7F0003B83E /* testwebserver.cpp */, + ); + path = testwebserver; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8DD76F620486A84900D96B5E /* MacTester */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "MacTester" */; + buildPhases = ( + 8DD76F640486A84900D96B5E /* Sources */, + 8DD76F660486A84900D96B5E /* Frameworks */, + 8DD76F690486A84900D96B5E /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + FD5DF9A909C0A537007E3F78 /* PBXTargetDependency */, + ); + name = MacTester; + productInstallPath = "$(HOME)/bin"; + productName = MacTester; + productReference = 8DD76F6C0486A84900D96B5E /* MacTester */; + productType = "com.apple.product-type.tool"; + }; + DA01B1C40ADE82C400A44198 /* TestWebClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = DA01B1EC0ADE82C400A44198 /* Build configuration list for PBXNativeTarget "TestWebClient" */; + buildPhases = ( + DA01B1C70ADE82C400A44198 /* Sources */, + DA01B1E80ADE82C400A44198 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + DA01B1C50ADE82C400A44198 /* PBXTargetDependency */, + ); + name = TestWebClient; + productName = TestWebServer; + productReference = DA01B1EF0ADE82C400A44198 /* TestWebClient */; + productType = "com.apple.product-type.tool"; + }; + FDF2E4170ADD7B620003B83E /* TestWebServer */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDF2E41E0ADD7B8D0003B83E /* Build configuration list for PBXNativeTarget "TestWebServer" */; + buildPhases = ( + FDF2E4150ADD7B620003B83E /* Sources */, + FDF2E4160ADD7B620003B83E /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + FDF2E41B0ADD7B690003B83E /* PBXTargetDependency */, + ); + name = TestWebServer; + productName = TestWebServer; + productReference = FDF2E4180ADD7B620003B83E /* TestWebServer */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 08FB7793FE84155DC02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "MacTester" */; + hasScannedForEncodings = 1; + mainGroup = 08FB7794FE84155DC02AAC07 /* MacTester */; + projectDirPath = ""; + targets = ( + FD5DF9A109C0A4F5007E3F78 /* third party libs */, + 8DD76F620486A84900D96B5E /* MacTester */, + FDF2E4170ADD7B620003B83E /* TestWebServer */, + DA01B1C40ADE82C400A44198 /* TestWebClient */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + FD5DF9A009C0A4F5007E3F78 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + 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"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8DD76F640486A84900D96B5E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FD5DF87B09C0A0FB007E3F78 /* test.cpp in Sources */, + FD5DF9F609C0E20E007E3F78 /* llsd_new_tut.cpp in Sources */, + FD5DFA9109C1DF3E007E3F78 /* lldate.cpp in Sources */, + FD5DFA9309C1DF4E007E3F78 /* lluuid.cpp in Sources */, + FD5DFA9909C1DFB7007E3F78 /* lluri.cpp in Sources */, + FD5DFAA009C1DFE2007E3F78 /* llerrorbuffer.cpp in Sources */, + FD5DFAA209C1DFE2007E3F78 /* llerrorstream.cpp in Sources */, + FD5DFAA609C1E01D007E3F78 /* llmd5.cpp in Sources */, + FD5DFAA909C1E056007E3F78 /* llerror.cpp in Sources */, + FD5DFAAC09C1E09F007E3F78 /* llrand.cpp in Sources */, + FD5DFAAF09C1E101007E3F78 /* llapr.cpp in Sources */, + FD5DFAB109C1E110007E3F78 /* llstring.cpp in Sources */, + FD5DFAB309C1E11A007E3F78 /* lltimer.cpp in Sources */, + FD5DFAB909C1E13A007E3F78 /* u64.cpp in Sources */, + FDEC4F5509F7EF7A007BAEEC /* llsd.cpp in Sources */, + FD506A0609FEB58900E297C2 /* llsdserialize.cpp in Sources */, + FD506A2F09FEC37900E297C2 /* llsdserialize_tut.cpp in Sources */, + FD506AA909FFC70100E297C2 /* llsdserialize_xml.cpp in Sources */, + FD15584D0A06BE2E00DE9AE5 /* io.cpp in Sources */, + FD15585C0A06BEB000DE9AE5 /* llbuffer.cpp in Sources */, + FD15585E0A06BEB000DE9AE5 /* llbufferstream.cpp in Sources */, + FD1558600A06BEB000DE9AE5 /* llinstantmessage.cpp in Sources */, + FD1558620A06BEB000DE9AE5 /* llioutil.cpp in Sources */, + FD1558640A06BEB000DE9AE5 /* llsdrpcclient.cpp in Sources */, + FD1558660A06BEB000DE9AE5 /* llsdrpcserver.cpp in Sources */, + FD15587F0A06BFAB00DE9AE5 /* llfiltersd2xmlrpc.cpp in Sources */, + FD1558810A06BFAB00DE9AE5 /* lliohttpserver.cpp in Sources */, + FD1558830A06BFAB00DE9AE5 /* lliopipe.cpp in Sources */, + FD1558850A06BFAB00DE9AE5 /* llpumpio.cpp in Sources */, + FD15588A0A06BFE400DE9AE5 /* llchainio.cpp in Sources */, + FD15588E0A06BFF100DE9AE5 /* llmemorystream.cpp in Sources */, + FD1558930A06C01400DE9AE5 /* llframetimer.cpp in Sources */, + FD1558970A06C05100DE9AE5 /* llurlrequest.cpp in Sources */, + FD7325940A08E7A60072A37B /* common.cpp in Sources */, + FD7325970A08E8260072A37B /* math.cpp in Sources */, + FD73259A0A08E8420072A37B /* inventory.cpp in Sources */, + FD73259F0A08E8A00072A37B /* llinventory.cpp in Sources */, + FD7325A60A08E8F00072A37B /* llxmlnode.cpp in Sources */, + FD7325AC0A08E9330072A37B /* llpermissions.cpp in Sources */, + FD7325B00A08E95F0072A37B /* llsaleinfo.cpp in Sources */, + FD7325BF0A08EA220072A37B /* lldir_mac.cpp in Sources */, + FD7325C10A08EA220072A37B /* lldir.cpp in Sources */, + FD7325C30A08EA220072A37B /* llvfile.cpp in Sources */, + FD7325CA0A08EB370072A37B /* llcircuit.cpp in Sources */, + FD7325CC0A08EB370072A37B /* message_prehash.cpp in Sources */, + FD7325D30A08EB590072A37B /* llthrottle.cpp in Sources */, + FD7325D80A08EB6B0072A37B /* lltransfermanager.cpp in Sources */, + FD7325E30A08EB970072A37B /* lltransfersourceasset.cpp in Sources */, + FD7325E50A08EB970072A37B /* lltransfersourcefile.cpp in Sources */, + FD7325E70A08EB970072A37B /* lltransfertargetfile.cpp in Sources */, + FD7325E90A08EB970072A37B /* lltransfertargetvfile.cpp in Sources */, + FD7325EE0A08EBBF0072A37B /* llqueuedthread.cpp in Sources */, + FD7325F20A08EBD20072A37B /* llvfsthread.cpp in Sources */, + FD7325F70A08EBE40072A37B /* llvfs.cpp in Sources */, + FD7325FC0A08EC140072A37B /* llthread.cpp in Sources */, + FD7326030A08EC490072A37B /* llassetstorage.cpp in Sources */, + FD7326070A08EC5B0072A37B /* llassettype.cpp in Sources */, + FD73260E0A08ECB70072A37B /* lldatapacker.cpp in Sources */, + FD7326130A08ECD90072A37B /* llhost.cpp in Sources */, + FD73261C0A08ED580072A37B /* llnamevalue.cpp in Sources */, + FD155EF40A08F0B300DE9AE5 /* m3math.cpp in Sources */, + FD155EF60A08F0B300DE9AE5 /* m4math.cpp in Sources */, + FD155EFA0A08F0DE00DE9AE5 /* llstringtable.cpp in Sources */, + FD155F030A08F36A00DE9AE5 /* llmemory.cpp in Sources */, + FD155F0B0A08F60B00DE9AE5 /* llnullcipher.cpp in Sources */, + FD155F0C0A08F60B00DE9AE5 /* llxorcipher.cpp in Sources */, + FD155F100A08F63200DE9AE5 /* message.cpp in Sources */, + FD155F1F0A08F9D200DE9AE5 /* llpacketring.cpp in Sources */, + FD155F240A08F9F600DE9AE5 /* v3math.cpp in Sources */, + FD155F2A0A08FA0F00DE9AE5 /* llpacketbuffer.cpp in Sources */, + FD155F2F0A08FA9800DE9AE5 /* net.cpp in Sources */, + FD155F340A08FAD900DE9AE5 /* llxfermanager.cpp in Sources */, + FD155F3F0A08FAF300DE9AE5 /* llxfer_file.cpp in Sources */, + FD155F410A08FAF300DE9AE5 /* llxfer_mem.cpp in Sources */, + FD155F430A08FAF300DE9AE5 /* llxfer_vfile.cpp in Sources */, + FD155F450A08FAF300DE9AE5 /* llxfer.cpp in Sources */, + FD155F610A08FD5900DE9AE5 /* llfasttimer.cpp in Sources */, + FD155F670A08FD9100DE9AE5 /* message_string_table.cpp in Sources */, + 389CFB470A0B69C700EE2094 /* llfile.cpp in Sources */, + 386C3F070A14C85000CF4511 /* lliosocket.cpp in Sources */, + 38A8BEAB0A18A2BC00814862 /* metaclass.cpp in Sources */, + 38A8BF630A18C31D00814862 /* metaproperty.cpp in Sources */, + 38A8BF750A18C42900814862 /* reflective.cpp in Sources */, + FDFBED130A1B591B0056E81E /* lliohttpserver_tut.cpp in Sources */, + FD9996A30A1C15B10057C816 /* llsdhttpserver.cpp in Sources */, + FD9996D80A1CA7570057C816 /* llpipeutil.cpp in Sources */, + FD396CDD0A1D37DF005DCB1F /* lltut.cpp in Sources */, + FD396D160A1DFB4B005DCB1F /* reflection_tut.cpp in Sources */, + DA306B450ACD9E8B008D9B2F /* llsdutil.cpp in Sources */, + DA306B460ACD9E8B008D9B2F /* llstreamtools.cpp in Sources */, + DA306B490ACD9EBC008D9B2F /* llapp.cpp in Sources */, + DA306B4E0ACD9EFD008D9B2F /* llcommon.cpp in Sources */, + DA306B4F0ACD9EFD008D9B2F /* llerrorthread.cpp in Sources */, + DA306B500ACD9EFD008D9B2F /* llrun.cpp in Sources */, + DA306B560ACD9F3F008D9B2F /* llapp_tut.cpp in Sources */, + DA306B570ACD9F3F008D9B2F /* llhttpclient_tut.cpp in Sources */, + DA306B580ACD9F3F008D9B2F /* lltiming_tut.cpp in Sources */, + DA306B590ACD9F3F008D9B2F /* lluri_tut.cpp in Sources */, + DA306B5C0ACD9F6F008D9B2F /* llhttpclient.cpp in Sources */, + FDCB2A670AF80D9000C44EBA /* llprocessor.cpp in Sources */, + FDFAD4210AFFFCC30048A0C7 /* llhttpnode.cpp in Sources */, + 91469E810B4486F20009E8F9 /* llmime.cpp in Sources */, + 91469E840B44870B0009E8F9 /* llmime_tut.cpp in Sources */, + 91469E8D0B4489420009E8F9 /* llquaternion.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DA01B1C70ADE82C400A44198 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DAD1C4CC0AE2C78C0054574C /* stats.cpp in Sources */, + DAD1C4DE0AE2CA0C0054574C /* llcurl.cpp in Sources */, + FDBC106D0AEEC3DA00ED2E62 /* llsd.cpp in Sources */, + FDBC106F0AEEC3E900ED2E62 /* lluuid.cpp in Sources */, + FDBC10710AEEC3F800ED2E62 /* llsdserialize.cpp in Sources */, + FDBC10720AEEC3F900ED2E62 /* llsdserialize_xml.cpp in Sources */, + FDBC10750AEEC41600ED2E62 /* lldate.cpp in Sources */, + FDBC10760AEEC41B00ED2E62 /* llmd5.cpp in Sources */, + FDBC10790AEEC42B00ED2E62 /* llerrorstream.cpp in Sources */, + FDBC107A0AEEC42C00ED2E62 /* llerrorbuffer.cpp in Sources */, + FDBC107B0AEEC43200ED2E62 /* lluri.cpp in Sources */, + FDBC107E0AEEC45100ED2E62 /* lltimer.cpp in Sources */, + FDBC107F0AEEC45400ED2E62 /* llfasttimer.cpp in Sources */, + FDBC10810AEEC46D00ED2E62 /* llapr.cpp in Sources */, + FDBC10860AEEC49800ED2E62 /* lliopipe.cpp in Sources */, + FDBC10870AEEC49D00ED2E62 /* llpumpio.cpp in Sources */, + FDBC10890AEEC4BA00ED2E62 /* llurlrequest.cpp in Sources */, + FDBC108B0AEEC4CD00ED2E62 /* llbuffer.cpp in Sources */, + FDBC108D0AEEC4E500ED2E62 /* llstring.cpp in Sources */, + FDBC108F0AEEC50200ED2E62 /* u64.cpp in Sources */, + FDBC10900AEEC50A00ED2E62 /* llmemory.cpp in Sources */, + FDBC10990AEEC57D00ED2E62 /* llhttpclient.cpp in Sources */, + FDBC109D0AEEC5EE00ED2E62 /* llbufferstream.cpp in Sources */, + FDBC109F0AEEC5FB00ED2E62 /* llchainio.cpp in Sources */, + FDBC10A10AEEC60F00ED2E62 /* llioutil.cpp in Sources */, + FDBC10A30AEEC62400ED2E62 /* llthread.cpp in Sources */, + FDBC10A50AEEC63200ED2E62 /* llerror.cpp in Sources */, + FDBC10A70AEEC64100ED2E62 /* llrand.cpp in Sources */, + FDBC10A90AEEC65700ED2E62 /* llstreamtools.cpp in Sources */, + FDBC10AB0AEEC66100ED2E62 /* testwebclient.cpp in Sources */, + FDBC10AD0AEEC67700ED2E62 /* llframetimer.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDF2E4150ADD7B620003B83E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + DA01B1C50ADE82C400A44198 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FD5DF9A109C0A4F5007E3F78 /* third party libs */; + targetProxy = FDBC10510AEEB7C300ED2E62 /* PBXContainerItemProxy */; + }; + FD5DF9A909C0A537007E3F78 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FD5DF9A109C0A4F5007E3F78 /* third party libs */; + targetProxy = FD5DF9A809C0A537007E3F78 /* PBXContainerItemProxy */; + }; + FDF2E41B0ADD7B690003B83E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FD5DF9A109C0A4F5007E3F78 /* third party libs */; + targetProxy = FDBC10500AEEB7C300ED2E62 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 1DEB923208733DC60010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INSTALL_PATH = "$(HOME)/bin"; + PRODUCT_NAME = MacTester; + }; + name = Debug; + }; + 1DEB923308733DC60010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + INSTALL_PATH = "$(HOME)/bin"; + PRODUCT_NAME = MacTester; + }; + name = Release; + }; + 1DEB923608733DC60010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ALTIVEC_EXTENSIONS = YES; + GCC_OPTIMIZATION_LEVEL = 1; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; + HEADER_SEARCH_PATHS = ( + "../../libraries/$(arch)-darwin/include", + ../../libraries/include, + ../llcommon, + ); + OTHER_CFLAGS = ( + "-DLL_DARWIN=1", + "-DLL_DEBUG=1", + "-D_DEBUG", + "-fconstant-cfstrings", + ); + OTHER_CPLUSPLUSFLAGS = ( + "$(OTHER_CFLAGS)", + "-ffor-scope", + "-Wno-reorder", + ); + PREBINDING = NO; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-sign-compare", + "-Wno-switch", + ); + }; + name = Debug; + }; + 1DEB923708733DC60010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ALTIVEC_EXTENSIONS = YES; + GCC_OPTIMIZATION_LEVEL = 3; + GCC_PREPROCESSOR_DEFINITIONS = "LL_DARWIN=1"; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; + HEADER_SEARCH_PATHS = ( + "../../libraries/$(arch)-darwin/include", + ../../libraries/include, + ../llcommon, + ); + OTHER_CFLAGS = ( + "-DLL_DARWIN=1", + "-DLL_RELEASE=1", + "-DLL_RELEASE_FOR_DOWNLOAD=1", + "-DNDEBUG", + "-fconstant-cfstrings", + ); + OTHER_CPLUSPLUSFLAGS = ( + "$(OTHER_CFLAGS)", + "-ffor-scope", + "-Wno-reorder", + ); + PREBINDING = NO; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-sign-compare", + "-Wno-switch", + ); + }; + name = Release; + }; + DA01B1ED0ADE82C400A44198 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES; + HEADER_SEARCH_PATHS = ( + "${PROJECT_DIR}/../../libraries/${CURRENT_ARCH}-darwin/include", + "${PROJECT_DIR}/../../libraries/include", + ); + INSTALL_PATH = "$(HOME)/bin"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_2)", + ); + LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Debug\""; + LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/build/Debug\""; + PREBINDING = NO; + PRODUCT_NAME = TestWebClient; + ZERO_LINK = YES; + }; + name = Debug; + }; + DA01B1EE0ADE82C400A44198 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G5; + GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES; + HEADER_SEARCH_PATHS = ( + "${PROJECT_DIR}/../../libraries/${CURRENT_ARCH}-darwin/include", + "${PROJECT_DIR}/../../libraries/include", + ); + INSTALL_PATH = "$(HOME)/bin"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_2)", + ); + LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Debug\""; + LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/build/Debug\""; + PREBINDING = NO; + PRODUCT_NAME = TestWebClient; + ZERO_LINK = NO; + }; + name = Release; + }; + FD5DF9A309C0A51D007E3F78 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + PRODUCT_NAME = "third party libs"; + }; + name = Debug; + }; + FD5DF9A409C0A51D007E3F78 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + PRODUCT_NAME = "third party libs"; + ZERO_LINK = NO; + }; + name = Release; + }; + FDF2E41F0ADD7B8D0003B83E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES; + HEADER_SEARCH_PATHS = ( + "${PROJECT_DIR}/../../libraries/${CURRENT_ARCH}-darwin/include", + "${PROJECT_DIR}/../../libraries/include", + ); + INSTALL_PATH = "$(HOME)/bin"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", + ); + LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Debug\""; + PREBINDING = NO; + PRODUCT_NAME = TestWebServer; + ZERO_LINK = YES; + }; + name = Debug; + }; + FDF2E4200ADD7B8D0003B83E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G5; + GCC_TREAT_NONCONFORMANT_CODE_ERRORS_AS_WARNINGS = YES; + HEADER_SEARCH_PATHS = ( + "${PROJECT_DIR}/../../libraries/${CURRENT_ARCH}-darwin/include", + "${PROJECT_DIR}/../../libraries/include", + ); + INSTALL_PATH = "$(HOME)/bin"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", + ); + LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/build/Debug\""; + PREBINDING = NO; + PRODUCT_NAME = TestWebServer; + ZERO_LINK = NO; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "MacTester" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB923208733DC60010E9CD /* Debug */, + 1DEB923308733DC60010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "MacTester" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB923608733DC60010E9CD /* Debug */, + 1DEB923708733DC60010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + DA01B1EC0ADE82C400A44198 /* Build configuration list for PBXNativeTarget "TestWebClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DA01B1ED0ADE82C400A44198 /* Debug */, + DA01B1EE0ADE82C400A44198 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FD5DF9A209C0A51D007E3F78 /* Build configuration list for PBXAggregateTarget "third party libs" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FD5DF9A309C0A51D007E3F78 /* Debug */, + FD5DF9A409C0A51D007E3F78 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDF2E41E0ADD7B8D0003B83E /* Build configuration list for PBXNativeTarget "TestWebServer" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDF2E41F0ADD7B8D0003B83E /* Debug */, + FDF2E4200ADD7B8D0003B83E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; +} 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 @@ +/** + * @file common.cpp + * @author Phoenix + * @date 2005-10-12 + * @brief Common templates for test framework + * + * Copyright (c) 2005-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +/** + * + * THOROUGH_DESCRIPTION of common.cpp + * + */ + +#include "linden_common.h" +#include "lltut.h" + +#include +#include +#include + +#include "llmemorystream.h" +#include "llsd.h" +#include "llsdserialize.h" + +namespace tut +{ + struct sd_data + { + }; + typedef test_group sd_test; + typedef sd_test::object sd_object; + tut::sd_test sd("llsd"); + + template<> template<> + void sd_object::test<1>() + { + std::ostringstream resp; + resp << "{'connect':true, 'position':[r128,r128,r128], 'look_at':[r0,r1,r0], 'agent_access':'M', 'region_x':i8192, 'region_y':i8192}"; + std::string str = resp.str(); + LLMemoryStream mstr((U8*)str.c_str(), str.size()); + LLSD response; + S32 count = LLSDSerialize::fromNotation(response, mstr); + ensure("stream parsed", response.isDefined()); + ensure_equals("stream parse count", count, 13); + ensure_equals("sd type", response.type(), LLSD::TypeMap); + ensure_equals("map element count", response.size(), 6); + ensure_equals("value connect", response["connect"].asBoolean(), true); + ensure_equals("value region_x", response["region_x"].asInteger(),8192); + ensure_equals("value region_y", response["region_y"].asInteger(),8192); + } + + template<> template<> + void sd_object::test<2>() + { + const std::string decoded("random"); + //const std::string encoded("cmFuZG9t\n"); + const std::string streamed("b(6)\"random\""); + typedef std::vector buf_t; + buf_t buf; + std::copy( + decoded.begin(), + decoded.end(), + std::back_insert_iterator(buf)); + LLSD sd; + sd = buf; + std::stringstream str; + S32 count = LLSDSerialize::toNotation(sd, str); + ensure_equals("output count", count, 1); + std::string actual(str.str()); + ensure_equals("formatted binary encoding", actual, streamed); + sd.clear(); + LLSDSerialize::fromNotation(sd, str); + std::vector after; + after = sd.asBinary(); + ensure_equals("binary decoded size", after.size(), decoded.size()); + ensure("binary decoding", (0 == memcmp( + &after[0], + decoded.c_str(), + decoded.size()))); + } + + template<> template<> + void sd_object::test<3>() + { + for(S32 i = 0; i < 100; ++i) + { + // gen up a starting point + typedef std::vector buf_t; + buf_t source; + srand(i); + S32 size = rand() % 1000 + 10; + std::generate_n( + std::back_insert_iterator(source), + size, + rand); + LLSD sd(source); + std::stringstream str; + S32 count = LLSDSerialize::toNotation(sd, str); + sd.clear(); + ensure_equals("format count", count, 1); + LLSD sd2; + count = LLSDSerialize::fromNotation(sd2, str); + ensure_equals("parse count", count, 1); + buf_t dest = sd2.asBinary(); + str.str(""); + str << "binary encoding size " << i; + ensure_equals(str.str().c_str(), dest.size(), source.size()); + str.str(""); + str << "binary encoding " << i; + ensure(str.str().c_str(), (source == dest)); + } + } + + template<> template<> + void sd_object::test<4>() + { + std::ostringstream ostr; + ostr << "{'task_id':u1fd77b79-a8e7-25a5-9454-02a4d948ba1c}\n" + << "{\n\tname\tObject|\n}\n"; + std::string expected = ostr.str(); + std::stringstream serialized; + serialized << "'" << LLSDNotationFormatter::escapeString(expected) + << "'"; + LLSD sd; + S32 count = LLSDSerialize::fromNotation(sd, serialized); + ensure_equals("parse count", count, 1); + ensure_equals("String streaming", sd.asString(), expected); + } + + template<> template<> + void sd_object::test<5>() + { + for(S32 i = 0; i < 100; ++i) + { + // gen up a starting point + typedef std::vector buf_t; + buf_t source; + srand(666 + i); + S32 size = rand() % 1000 + 10; + std::generate_n( + std::back_insert_iterator(source), + size, + rand); + std::stringstream str; + str << "b(" << size << ")\""; + str.write((const char*)&source[0], size); + str << "\""; + LLSD sd; + S32 count = LLSDSerialize::fromNotation(sd, str); + ensure_equals("binary parse", count, 1); + buf_t actual = sd.asBinary(); + ensure_equals("binary size", actual.size(), (size_t)size); + ensure("binary data", (0 == memcmp(&source[0], &actual[0], size))); + } + } + + template<> template<> + void sd_object::test<6>() + { + std::string expected("'{\"task_id\":u1fd77b79-a8e7-25a5-9454-02a4d948ba1c}'\t\n\t\t"); + std::stringstream str; + str << "s(" << expected.size() << ")'"; + str.write(expected.c_str(), expected.size()); + str << "'"; + LLSD sd; + S32 count = LLSDSerialize::fromNotation(sd, str); + ensure_equals("parse count", count, 1); + std::string actual = sd.asString(); + ensure_equals("string sizes", actual.size(), expected.size()); + ensure_equals("string content", actual, expected); + } + + template<> template<> + void sd_object::test<7>() + { + std::string msg("come on in"); + std::stringstream stream; + stream << "{'connect':1, 'message':'" << msg << "'," + << " 'position':[r45.65,r100.1,r25.5]," + << " 'look_at':[r0,r1,r0]," + << " 'agent_access':'PG'}"; + LLSD sd; + S32 count = LLSDSerialize::fromNotation(sd, stream); + ensure_equals("parse count", count, 12); + ensure_equals("bool value", sd["connect"].asBoolean(), true); + ensure_equals("message value", sd["message"].asString(), msg); + ensure_equals("pos x", sd["position"][0].asReal(), 45.65); + ensure_equals("pos y", sd["position"][1].asReal(), 100.1); + ensure_equals("pos z", sd["position"][2].asReal(), 25.5); + ensure_equals("look x", sd["look_at"][0].asReal(), 0.0); + ensure_equals("look y", sd["look_at"][1].asReal(), 1.0); + ensure_equals("look z", sd["look_at"][2].asReal(), 0.0); + } + + template<> template<> + void sd_object::test<8>() + { + std::stringstream resp; + resp << "{'label':'short string test', 'singlechar':'a', 'empty':'', 'endoftest':'end' }"; + LLSD response; + S32 count = LLSDSerialize::fromNotation(response, resp); + ensure_equals("parse count", count, 5); + ensure_equals("sd type", response.type(), LLSD::TypeMap); + ensure_equals("map element count", response.size(), 4); + ensure_equals("singlechar", response["singlechar"].asString(), "a"); + ensure_equals("empty", response["empty"].asString(), ""); + } + + template<> template<> + void sd_object::test<9>() + { + std::ostringstream resp; + resp << "{'label':'short binary test', 'singlebinary':b(1)\"A\", 'singlerawstring':s(1)\"A\", 'endoftest':'end' }"; + std::string str = resp.str(); + LLSD sd; + LLMemoryStream mstr((U8*)str.c_str(), str.size()); + S32 count = LLSDSerialize::fromNotation(sd, mstr); + ensure_equals("parse count", count, 5); + ensure("sd created", sd.isDefined()); + ensure_equals("sd type", sd.type(), LLSD::TypeMap); + ensure_equals("map element count", sd.size(), 4); + ensure_equals( + "label", + sd["label"].asString(), + "short binary test"); + std::vector bin = sd["singlebinary"].asBinary(); + std::vector expected; + expected.resize(1); + expected[0] = 'A'; + ensure("single binary", (0 == memcmp(&bin[0], &expected[0], 1))); + ensure_equals( + "single string", + sd["singlerawstring"].asString(), + std::string("A")); + ensure_equals("end", sd["endoftest"].asString(), "end"); + } + + template<> template<> + void sd_object::test<10>() + { + + std::string message("parcel '' is naughty."); + std::stringstream str; + str << "{'message':'" << LLSDNotationFormatter::escapeString(message) + << "'}"; + std::string expected_str("{'message':'parcel \\'\\' is naughty.'}"); + std::string actual_str = str.str(); + ensure_equals("stream contents", actual_str, expected_str); + LLSD sd; + S32 count = LLSDSerialize::fromNotation(sd, str); + ensure_equals("parse count", count, 2); + ensure("valid parse", sd.isDefined()); + std::string actual = sd["message"].asString(); + ensure_equals("message contents", actual, message); + } + + template<> template<> + void sd_object::test<11>() + { + std::string expected("\"\"\"\"''''''\""); + std::stringstream str; + str << "'" << LLSDNotationFormatter::escapeString(expected) << "'"; + LLSD sd; + S32 count = LLSDSerialize::fromNotation(sd, str); + ensure_equals("parse count", count, 1); + ensure_equals("string value", sd.asString(), expected); + } + + template<> template<> + void sd_object::test<12>() + { + std::string expected("mytest\\"); + std::stringstream str; + str << "'" << LLSDNotationFormatter::escapeString(expected) << "'"; + LLSD sd; + S32 count = LLSDSerialize::fromNotation(sd, str); + ensure_equals("parse count", count, 1); + ensure_equals("string value", sd.asString(), expected); + } + + template<> template<> + void sd_object::test<13>() + { + for(S32 i = 0; i < 10000; ++i) + { + // gen up a starting point + std::string expected; + srand(1337 + i); + S32 size = rand() % 30 + 5; + std::generate_n( + std::back_insert_iterator(expected), + size, + rand); + std::stringstream str; + str << "'" << LLSDNotationFormatter::escapeString(expected) << "'"; + LLSD sd; + S32 count = LLSDSerialize::fromNotation(sd, str); + ensure_equals("parse count", count, 1); + std::string actual = sd.asString(); +/* + if(actual != expected) + { + llwarns << "iteration " << i << llendl; + std::ostringstream e_str; + std::string::iterator iter = expected.begin(); + std::string::iterator end = expected.end(); + for(; iter != end; ++iter) + { + e_str << (S32)((U8)(*iter)) << " "; + } + e_str << std::endl; + llsd_serialize_string(e_str, expected); + llwarns << "expected size: " << expected.size() << llendl; + llwarns << "expected: " << e_str.str() << llendl; + + std::ostringstream a_str; + iter = actual.begin(); + end = actual.end(); + for(; iter != end; ++iter) + { + a_str << (S32)((U8)(*iter)) << " "; + } + a_str << std::endl; + llsd_serialize_string(a_str, actual); + llwarns << "actual size: " << actual.size() << llendl; + llwarns << "actual: " << a_str.str() << llendl; + } +*/ + ensure_equals("string value", actual, expected); + } + } + + template<> template<> + void sd_object::test<14>() + { + 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}]"; + std::istringstream istr; + istr.str(param); + LLSD param_sd; + LLSDSerialize::fromNotation(param_sd, istr); + ensure_equals("parsed type", param_sd.type(), LLSD::TypeArray); + LLSD version_sd = param_sd[0]; + ensure_equals("version type", version_sd.type(), LLSD::TypeMap); + ensure("has version", version_sd.has("version")); + ensure_equals("version number", version_sd["version"].asInteger(), 1); + LLSD src_sd = param_sd[1]; + ensure_equals("src type", src_sd.type(), LLSD::TypeMap); + LLSD dst_sd = param_sd[2]; + ensure_equals("dst type", dst_sd.type(), LLSD::TypeMap); + } + + template<> template<> + void sd_object::test<15>() + { + std::string val = "[{'failures':!,'successfuls':[u3c115e51-04f4-523c-9fa6-98aff1034730]}]"; + std::istringstream istr; + istr.str(val); + LLSD sd; + LLSDSerialize::fromNotation(sd, istr); + ensure_equals("parsed type", sd.type(), LLSD::TypeArray); + ensure_equals("parsed size", sd.size(), 1); + LLSD failures = sd[0]["failures"]; + ensure("no failures.", failures.isUndefined()); + LLSD success = sd[0]["successfuls"]; + ensure_equals("success type", success.type(), LLSD::TypeArray); + ensure_equals("success size", success.size(), 1); + ensure_equals("success instance type", success[0].type(), LLSD::TypeUUID); + } + + template<> template<> + void sd_object::test<16>() + { + std::string val = "[f,t,0,1,{'foo':t,'bar':f}]"; + std::istringstream istr; + istr.str(val); + LLSD sd; + LLSDSerialize::fromNotation(sd, istr); + ensure_equals("parsed type", sd.type(), LLSD::TypeArray); + ensure_equals("parsed size", sd.size(), 5); + ensure_equals("element 0 false", sd[0].asBoolean(), false); + ensure_equals("element 1 true", sd[1].asBoolean(), true); + ensure_equals("element 2 false", sd[2].asBoolean(), false); + ensure_equals("element 3 true", sd[3].asBoolean(), true); + LLSD map = sd[4]; + ensure_equals("element 4 type", map.type(), LLSD::TypeMap); + ensure_equals("map foo type", map["foo"].type(), LLSD::TypeBoolean); + ensure_equals("map foo value", map["foo"].asBoolean(), true); + ensure_equals("map bar type", map["bar"].type(), LLSD::TypeBoolean); + ensure_equals("map bar value", map["bar"].asBoolean(), false); + } + +/* + template<> template<> + void sd_object::test<16>() + { + } +*/ +} + +#if 0 +'{\'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' +#endif + +namespace tut +{ + struct mem_data + { + }; + typedef test_group mem_test; + typedef mem_test::object mem_object; + tut::mem_test mem_stream("memory_stream"); + + template<> template<> + void mem_object::test<1>() + { + const char HELLO_WORLD[] = "hello world"; + LLMemoryStream mem((U8*)&HELLO_WORLD[0], strlen(HELLO_WORLD)); + std::string hello; + std::string world; + mem >> hello >> world; + ensure_equals("first word", hello, std::string("hello")); + ensure_equals("second word", world, std::string("world")); + } +} + 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 @@ +test/common.cpp +test/inventory.cpp +test/io.cpp +test/llapp_tut.cpp +test/llhttpclient_tut.cpp +test/llhttpnode_tut.cpp +test/lliohttpserver_tut.cpp +test/llmime_tut.cpp +test/llpipeutil.cpp +test/llsd_new_tut.cpp +test/llsdserialize_tut.cpp +test/llsd_message_system_tut.cpp +test/lltiming_tut.cpp +test/lltut.cpp +test/lluri_tut.cpp +test/math.cpp +test/reflection_tut.cpp +test/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 @@ +/** + * @file inventory.cpp + * @author Phoenix + * @date 2005-11-15 + * @brief Functions for inventory test framework + * + * Copyright (c) 2005-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +/** + * + * THOROUGH_DESCRIPTION of inventory.cpp + * + */ + +#include "linden_common.h" +#include "lltut.h" +#include "llinventory.h" +#include "llsd.h" + +LLPointer create_random_inventory_item() +{ + LLUUID item_id; + item_id.generate(); + LLUUID parent_id; + parent_id.generate(); + LLPermissions perm; + LLUUID creator_id; + creator_id.generate(); + LLUUID owner_id; + owner_id.generate(); + LLUUID last_owner_id; + last_owner_id.generate(); + LLUUID group_id; + group_id.generate(); + perm.init(creator_id, owner_id, last_owner_id, group_id); + perm.initMasks(PERM_ALL, PERM_ALL, PERM_COPY, PERM_COPY, PERM_MODIFY | PERM_COPY); + LLUUID asset_id; + asset_id.generate(); + S32 price = rand(); + LLSaleInfo sale_info(LLSaleInfo::FS_COPY, price); + U32 flags = rand(); + S32 creation = time(NULL); + + LLPointer item = new LLInventoryItem( + item_id, + parent_id, + perm, + asset_id, + LLAssetType::AT_OBJECT, + LLInventoryType::IT_ATTACHMENT, + "Sample Object", + "Used for Testing", + sale_info, + flags, + creation); + return item; +} + +LLPointer create_random_inventory_cat() +{ + LLUUID item_id; + item_id.generate(); + LLUUID parent_id; + parent_id.generate(); + + LLPointer cat = new LLInventoryCategory( + item_id, + parent_id, + LLAssetType::AT_NONE, + "Sample category"); + return cat; +} + +namespace tut +{ + struct inventory_data + { + }; + typedef test_group inventory_test; + typedef inventory_test::object inventory_object; + tut::inventory_test inv("llinventory"); + + template<> template<> + void inventory_object::test<1>() + { + LLPointer src = create_random_inventory_item(); + LLSD sd = ll_create_sd_from_inventory_item(src); + //llinfos << "sd: " << *sd << llendl; + LLPointer dst; + dst = ll_create_item_from_sd(sd); + ensure_equals("item id", dst->getUUID(), src->getUUID()); + ensure_equals("parent", dst->getParentUUID(), src->getParentUUID()); + ensure_equals("name", dst->getName(), src->getName()); + ensure_equals("type", dst->getType(), src->getType()); + ensure_equals( + "permissions", + dst->getPermissions(), + src->getPermissions()); + ensure_equals( + "description", + dst->getDescription(), + src->getDescription()); + ensure_equals( + "sale type", + dst->getSaleInfo().getSaleType(), + src->getSaleInfo().getSaleType()); + ensure_equals( + "sale price", + dst->getSaleInfo().getSalePrice(), + src->getSaleInfo().getSalePrice()); + ensure_equals("asset id", dst->getAssetUUID(), src->getAssetUUID()); + ensure_equals( + "inventory type", + dst->getInventoryType(), + src->getInventoryType()); + ensure_equals("flags", dst->getFlags(), src->getFlags()); + ensure_equals( + "creation", + dst->getCreationDate(), + src->getCreationDate()); + } + + template<> template<> + void inventory_object::test<2>() + { + LLPointer src = create_random_inventory_cat(); + LLSD sd = ll_create_sd_from_inventory_category(src); + LLPointer dst = ll_create_category_from_sd(sd); + ensure_equals("item id", dst->getUUID(), src->getUUID()); + ensure_equals("parent", dst->getParentUUID(), src->getParentUUID()); + ensure_equals("name", dst->getName(), src->getName()); + ensure_equals("type", dst->getType(), src->getType()); + ensure_equals( + "preferred type", + dst->getPreferredType(), + src->getPreferredType()); + } + +/* + template<> template<> + void inventory_object::test<3>() + { + + } +*/ +} 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 @@ +/** + * @file io.cpp + * @author Phoenix + * @date 2005-10-02 + * @brief Tests for io classes and helpers + * + * Copyright (c) 2005-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include "linden_common.h" +#include "lltut.h" + +#include + +#include + +#include "llbuffer.h" +#include "llbufferstream.h" +#include "lliosocket.h" +#include "llioutil.h" +#include "llmemorystream.h" +#include "llpipeutil.h" +#include "llpumpio.h" +#include "llsd.h" +#include "llsdrpcclient.h" +#include "llsdrpcserver.h" +#include "llsdserialize.h" +#include "lluuid.h" +#include "llinstantmessage.h" + +namespace tut +{ + struct buffer_data + { + LLBufferArray mBuffer; + }; + typedef test_group buffer_test; + typedef buffer_test::object buffer_object; + tut::buffer_test tba("buffer_array"); + + template<> template<> + void buffer_object::test<1>() + { + const char HELLO_WORLD[] = "hello world"; + const S32 str_len = strlen(HELLO_WORLD); + LLChannelDescriptors ch = mBuffer.nextChannel(); + mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len); + S32 count = mBuffer.countAfter(ch.in(), NULL); + ensure_equals("total append size", count, str_len); + LLBufferArray::segment_iterator_t it = mBuffer.beginSegment(); + U8* first = (*it).data(); + count = mBuffer.countAfter(ch.in(), first); + ensure_equals("offset append size", count, str_len - 1); + } + + template<> template<> + void buffer_object::test<2>() + { + const char HELLO_WORLD[] = "hello world"; + const S32 str_len = strlen(HELLO_WORLD); + LLChannelDescriptors ch = mBuffer.nextChannel(); + mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len); + mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len); + S32 count = mBuffer.countAfter(ch.in(), NULL); + ensure_equals("total append size", count, 2 * str_len); + LLBufferArray::segment_iterator_t it = mBuffer.beginSegment(); + U8* first = (*it).data(); + count = mBuffer.countAfter(ch.in(), first); + ensure_equals("offset append size", count, (2 * str_len) - 1); + } + + template<> template<> + void buffer_object::test<3>() + { + const char ONE[] = "one"; + const char TWO[] = "two"; + std::string expected(ONE); + expected.append(TWO); + LLChannelDescriptors ch = mBuffer.nextChannel(); + mBuffer.append(ch.in(), (U8*)ONE, 3); + mBuffer.append(ch.in(), (U8*)TWO, 3); + char buffer[255]; + S32 len = 6; + mBuffer.readAfter(ch.in(), NULL, (U8*)buffer, len); + ensure_equals(len, 6); + buffer[len] = '\0'; + std::string actual(buffer); + ensure_equals("read", actual, expected); + } + + template<> template<> + void buffer_object::test<4>() + { + const char ONE[] = "one"; + const char TWO[] = "two"; + std::string expected(ONE); + expected.append(TWO); + LLChannelDescriptors ch = mBuffer.nextChannel(); + mBuffer.append(ch.in(), (U8*)TWO, 3); + mBuffer.prepend(ch.in(), (U8*)ONE, 3); + char buffer[255]; + S32 len = 6; + mBuffer.readAfter(ch.in(), NULL, (U8*)buffer, len); + ensure_equals(len, 6); + buffer[len] = '\0'; + std::string actual(buffer); + ensure_equals("read", actual, expected); + } + + template<> template<> + void buffer_object::test<5>() + { + const char ONE[] = "one"; + const char TWO[] = "two"; + std::string expected("netwo"); + LLChannelDescriptors ch = mBuffer.nextChannel(); + mBuffer.append(ch.in(), (U8*)TWO, 3); + mBuffer.prepend(ch.in(), (U8*)ONE, 3); + char buffer[255]; + S32 len = 5; + LLBufferArray::segment_iterator_t it = mBuffer.beginSegment(); + U8* addr = (*it).data(); + mBuffer.readAfter(ch.in(), addr, (U8*)buffer, len); + ensure_equals(len, 5); + buffer[len] = '\0'; + std::string actual(buffer); + ensure_equals("read", actual, expected); + } + + template<> template<> + void buffer_object::test<6>() + { + std::string request("The early bird catches the worm."); + std::string response("If you're a worm, sleep late."); + std::ostringstream expected; + expected << "ContentLength: " << response.length() << "\r\n\r\n" + << response; + LLChannelDescriptors ch = mBuffer.nextChannel(); + mBuffer.append(ch.in(), (U8*)request.c_str(), request.length()); + mBuffer.append(ch.out(), (U8*)response.c_str(), response.length()); + S32 count = mBuffer.countAfter(ch.out(), NULL); + std::ostringstream header; + header << "ContentLength: " << count << "\r\n\r\n"; + std::string head(header.str()); + mBuffer.prepend(ch.out(), (U8*)head.c_str(), head.length()); + char buffer[1024]; + S32 len = response.size() + head.length(); + ensure_equals("same length", len, (S32)expected.str().length()); + mBuffer.readAfter(ch.out(), NULL, (U8*)buffer, len); + buffer[len] = '\0'; + std::string actual(buffer); + ensure_equals("threaded writes", actual, expected.str()); + } + + template<> template<> + void buffer_object::test<7>() + { + const S32 LINE_COUNT = 3; + std::string lines[LINE_COUNT] = + { + std::string("GET /index.htm HTTP/1.0\r\n"), + std::string("User-Agent: Wget/1.9.1\r\n"), + std::string("Host: localhost:8008\r\n") + }; + std::string text; + S32 i; + for(i = 0; i < LINE_COUNT; ++i) + { + text.append(lines[i]); + } + LLChannelDescriptors ch = mBuffer.nextChannel(); + mBuffer.append(ch.in(), (U8*)text.c_str(), text.length()); + const S32 BUFFER_LEN = 1024; + char buf[BUFFER_LEN]; + S32 len; + U8* last = NULL; + std::string last_line; + for(i = 0; i < LINE_COUNT; ++i) + { + len = BUFFER_LEN; + last = mBuffer.readAfter(ch.in(), last, (U8*)buf, len); + char* newline = strchr((char*)buf, '\n'); + S32 offset = -((len - 1) - (newline - buf)); + ++newline; + *newline = '\0'; + last_line.assign(buf); + std::ostringstream message; + message << "line reads in line[" << i << "]"; + ensure_equals(message.str().c_str(), last_line, lines[i]); + last = mBuffer.seek(ch.in(), last, offset); + } + } + + template<> template<> + void buffer_object::test<8>() + { + LLChannelDescriptors ch = mBuffer.nextChannel(); + mBuffer.append(ch.in(), (U8*)"1", 1); + LLBufferArray buffer; + buffer.append(ch.in(), (U8*)"2", 1); + mBuffer.takeContents(buffer); + mBuffer.append(ch.in(), (U8*)"3", 1); + S32 count = mBuffer.countAfter(ch.in(), NULL); + ensure_equals("buffer size", count, 3); + U8* temp = new U8[count]; + mBuffer.readAfter(ch.in(), NULL, temp, count); + ensure("buffer content", (0 == memcmp(temp, (void*)"123", 3))); + delete[] temp; + } + +/* + template<> template<> + void buffer_object::test<9>() + { + char buffer[1024]; + S32 size = sprintf(buffer, + "%d|%d|%s|%s|%s|%s|%s|%x|%x|%x|%x|%x|%s|%s|%d|%d|%x", + 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", + 0x7fffffff, + 0x7fffffff, + 0, + 0, + 0x7fffffff, + "69e0d357-2e7c-8990-a2bc-7f61c868e5a3", + "2004-06-04 16:09:17 note card", + 0, + 10, + 0) + 1; + + //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"; + + LLSD* bin_bucket = LLIMInfo::buildSDfrombuffer((U8*)buffer,size); + + char post_buffer[1024]; + U32 post_size; + LLIMInfo::getBinaryBucket(bin_bucket,(U8*)post_buffer,post_size); + ensure_equals("Buffer sizes",size,(S32)post_size); + ensure("Buffer content",!strcmp(buffer,post_buffer)); + } +*/ + + /* + template<> template<> + void buffer_object::test<>() + { + } + */ +} + +namespace tut +{ + struct buffer_and_stream_data + { + LLBufferArray mBuffer; + }; + typedef test_group bas_test; + typedef bas_test::object bas_object; + tut::bas_test tbs("buffer_stream"); + + template<> template<> + void bas_object::test<1>() + { + const char HELLO_WORLD[] = "hello world"; + const S32 str_len = strlen(HELLO_WORLD); + LLChannelDescriptors ch = mBuffer.nextChannel(); + LLBufferStream str(ch, &mBuffer); + mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len); + std::string hello; + std::string world; + str >> hello >> world; + ensure_equals("first word", hello, std::string("hello")); + ensure_equals("second word", world, std::string("world")); + } + + template<> template<> + void bas_object::test<2>() + { + std::string part1("Eat my shor"); + std::string part2("ts ho"); + std::string part3("mer"); + std::string ignore("ignore me"); + LLChannelDescriptors ch = mBuffer.nextChannel(); + LLBufferStream str(ch, &mBuffer); + mBuffer.append(ch.in(), (U8*)part1.c_str(), part1.length()); + mBuffer.append(ch.in(), (U8*)part2.c_str(), part2.length()); + mBuffer.append(ch.out(), (U8*)ignore.c_str(), ignore.length()); + mBuffer.append(ch.in(), (U8*)part3.c_str(), part3.length()); + std::string eat; + std::string my; + std::string shorts; + std::string homer; + str >> eat >> my >> shorts >> homer; + ensure_equals("word1", eat, std::string("Eat")); + ensure_equals("word2", my, std::string("my")); + ensure_equals("word3", shorts, std::string("shorts")); + ensure_equals("word4", homer, std::string("homer")); + } + + template<> template<> + void bas_object::test<3>() + { + std::string part1("junk in "); + std::string part2("the trunk"); + const S32 CHANNEL = 0; + mBuffer.append(CHANNEL, (U8*)part1.c_str(), part1.length()); + mBuffer.append(CHANNEL, (U8*)part2.c_str(), part2.length()); + U8* last = 0; + const S32 BUF_LEN = 128; + char buf[BUF_LEN]; + S32 len = 11; + last = mBuffer.readAfter(CHANNEL, last, (U8*)buf, len); + buf[len] = '\0'; + std::string actual(buf); + ensure_equals("first read", actual, std::string("junk in the")); + last = mBuffer.seek(CHANNEL, last, -6); + len = 12; + last = mBuffer.readAfter(CHANNEL, last, (U8*)buf, len); + buf[len] = '\0'; + actual.assign(buf); + ensure_equals("seek and read", actual, std::string("in the trunk")); + } + + template<> template<> + void bas_object::test<4>() + { + std::string phrase("zippity do da!"); + const S32 CHANNEL = 0; + mBuffer.append(CHANNEL, (U8*)phrase.c_str(), phrase.length()); + const S32 BUF_LEN = 128; + char buf[BUF_LEN]; + S32 len = 7; + U8* last = mBuffer.readAfter(CHANNEL, NULL, (U8*)buf, len); + mBuffer.splitAfter(last); + LLBufferArray::segment_iterator_t it = mBuffer.beginSegment(); + LLBufferArray::segment_iterator_t end = mBuffer.endSegment(); + std::string first((char*)((*it).data()), (*it).size()); + ensure_equals("first part", first, std::string("zippity")); + ++it; + std::string second((char*)((*it).data()), (*it).size()); + ensure_equals("second part", second, std::string(" do da!")); + ++it; + ensure("iterators equal", (it == end)); + } + + template<> template<> + void bas_object::test<5>() + { + LLChannelDescriptors ch = mBuffer.nextChannel(); + LLBufferStream str(ch, &mBuffer); + std::string h1("hello"); + std::string h2(", how are you doing?"); + std::string expected(h1); + expected.append(h2); + str << h1 << h2; + str.flush(); + const S32 BUF_LEN = 128; + char buf[BUF_LEN]; + S32 actual_len = BUF_LEN; + S32 expected_len = h1.size() + h2.size(); + (void) mBuffer.readAfter(ch.out(), NULL, (U8*)buf, actual_len); + ensure_equals("streamed size", actual_len, expected_len); + buf[actual_len] = '\0'; + std::string actual(buf); + ensure_equals("streamed to buf", actual, expected); + } + + template<> template<> + void bas_object::test<6>() + { + LLChannelDescriptors ch = mBuffer.nextChannel(); + LLBufferStream bstr(ch, &mBuffer); + std::ostringstream ostr; + std::vector ids; + LLUUID id; + for(int i = 0; i < 5; ++i) + { + id.generate(); + ids.push_back(id); + } + bstr << "SELECT concat(u.username, ' ', l.name) " + << "FROM user u, user_last_name l " + << "WHERE u.last_name_id = l.last_name_id" + << " AND u.agent_id IN ('"; + ostr << "SELECT concat(u.username, ' ', l.name) " + << "FROM user u, user_last_name l " + << "WHERE u.last_name_id = l.last_name_id" + << " AND u.agent_id IN ('"; + std::copy( + ids.begin(), + ids.end(), + std::ostream_iterator(bstr, "','")); + std::copy( + ids.begin(), + ids.end(), + std::ostream_iterator(ostr, "','")); + bstr.seekp(-2, std::ios::cur); + ostr.seekp(-2, std::ios::cur); + bstr << ") "; + ostr << ") "; + bstr.flush(); + const S32 BUF_LEN = 512; + char buf[BUF_LEN]; + S32 actual_len = BUF_LEN; + (void) mBuffer.readAfter(ch.out(), NULL, (U8*)buf, actual_len); + buf[actual_len] = '\0'; + std::string actual(buf); + std::string expected(ostr.str()); + ensure_equals("size of string in seek",actual.size(),expected.size()); + ensure_equals("seek in ostream", actual, expected); + } + + template<> template<> + void bas_object::test<7>() + { + LLChannelDescriptors ch = mBuffer.nextChannel(); + LLBufferStream bstr(ch, &mBuffer); + bstr << "1"; + bstr.flush(); + S32 count = mBuffer.countAfter(ch.out(), NULL); + ensure_equals("buffer size 1", count, 1); + LLBufferArray buffer; + buffer.append(ch.out(), (U8*)"2", 1); + mBuffer.takeContents(buffer); + count = mBuffer.countAfter(ch.out(), NULL); + ensure_equals("buffer size 2", count, 2); + bstr << "3"; + bstr.flush(); + count = mBuffer.countAfter(ch.out(), NULL); + ensure_equals("buffer size 3", count, 3); + U8* temp = new U8[count]; + mBuffer.readAfter(ch.out(), NULL, temp, count); + ensure("buffer content", (0 == memcmp(temp, (void*)"123", 3))); + delete[] temp; + } + + template<> template<> + void bas_object::test<8>() + { + LLChannelDescriptors ch = mBuffer.nextChannel(); + LLBufferStream ostr(ch, &mBuffer); + typedef std::vector buf_t; + typedef std::vector actual_t; + actual_t actual; + buf_t source; + bool need_comma = false; + ostr << "["; + S32 total_size = 1; + for(S32 i = 2000; i < 2003; ++i) + { + if(need_comma) + { + ostr << ","; + ++total_size; + } + need_comma = true; + srand(69 + i); + S32 size = rand() % 1000 + 1000; + std::generate_n( + std::back_insert_iterator(source), + size, + rand); + actual.push_back(source); + ostr << "b(" << size << ")\""; + total_size += 8; + ostr.write((const char*)(&source[0]), size); + total_size += size; + source.clear(); + ostr << "\""; + ++total_size; + } + ostr << "]"; + ++total_size; + ostr.flush(); + + // now that we have a bunch of data on a stream, parse it all. + ch = mBuffer.nextChannel(); + S32 count = mBuffer.countAfter(ch.in(), NULL); + ensure_equals("size of buffer", count, total_size); + LLBufferStream istr(ch, &mBuffer); + LLSD data; + count = LLSDSerialize::fromNotation(data, istr); + ensure("sd parsed", data.isDefined()); + + for(S32 j = 0; j < 3; ++j) + { + std::ostringstream name; + LLSD child(data[j]); + name << "found buffer " << j; + ensure(name.str(), child.isDefined()); + source = child.asBinary(); + name.str(""); + name << "buffer " << j << " size"; + ensure_equals(name.str().c_str(), source.size(), actual[j].size()); + name.str(""); + name << "buffer " << j << " contents"; + ensure( + name.str(), + (0 == memcmp(&source[0], &actual[j][0], source.size()))); + } + } + + template<> template<> + void bas_object::test<9>() + { + LLChannelDescriptors ch = mBuffer.nextChannel(); + LLBufferStream ostr(ch, &mBuffer); + typedef std::vector buf_t; + buf_t source; + bool need_comma = false; + ostr << "{"; + S32 total_size = 1; + for(S32 i = 1000; i < 3000; ++i) + { + if(need_comma) + { + ostr << ","; + ++total_size; + } + need_comma = true; + ostr << "'" << i << "':"; + total_size += 7; + srand(69 + i); + S32 size = rand() % 1000 + 1000; + std::generate_n( + std::back_insert_iterator(source), + size, + rand); + ostr << "b(" << size << ")\""; + total_size += 8; + ostr.write((const char*)(&source[0]), size); + total_size += size; + source.clear(); + ostr << "\""; + ++total_size; + } + ostr << "}"; + ++total_size; + ostr.flush(); + + // now that we have a bunch of data on a stream, parse it all. + ch = mBuffer.nextChannel(); + S32 count = mBuffer.countAfter(ch.in(), NULL); + ensure_equals("size of buffer", count, total_size); + LLBufferStream istr(ch, &mBuffer); + LLSD data; + count = LLSDSerialize::fromNotation(data, istr); + ensure("sd parsed", data.isDefined()); + } + + template<> template<> + void bas_object::test<10>() + { + const char LOGIN_STREAM[] = "{'method':'login', 'parameter': [ {" + "'uri': 'sl-am:kellys.region.siva.lindenlab.com/location?start=url&px=128&py=128&pz=128&lx=0&ly=0&lz=0'}, " + "{'version': i1}, {'texture_data': [ '61d724fb-ad79-f637-2186-5cf457560daa', '6e38b9be-b7cc-e77a-8aec-029a42b0b416', " + "'a9073524-e89b-2924-ca6e-a81944109a1a', '658f18b5-5f1e-e593-f5d5-36c3abc7249a', '0cc799f4-8c99-6b91-bd75-b179b12429e2', " + "'59fd9b64-8300-a425-aad8-2ffcbe9a49d2', '59fd9b64-8300-a425-aad8-2ffcbe9a49d2', '5748decc-f629-461c-9a36-a35a221fe21f', " + "'b8fc9be2-26a6-6b47-690b-0e902e983484', 'a13ca0fe-3802-dc97-e79a-70d12171c724', 'dd9643cf-fd5d-0376-ed4a-b1cc646a97d5', " + "'4ad13ae9-a112-af09-210a-cf9353a7a9e7', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', " + "'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', " + "'5748decc-f629-461c-9a36-a35a221fe21f', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97']," + "'session_id': '324cfa9f-fe5d-4d1c-a317-35f20a86a4d1','position': [ i128, i128, i128],'last_name': 'Linden','group_title': '-> !BLING! <-','group_name': 'test!','agent_access': 'M'," + "'attachment_data': [ {'asset_id': 'aaede2b1-9955-09d4-5c93-2b557c778cf3','attachment_point': i6,'item_id': 'f3694abc-5122-db33-73d9-e0f4288dc2bf'}]," + "'buddy_ids': [ '101358d5-469d-4b24-9b85-4dc3c05e635d', '1b00fec7-6265-4875-acac-80d9cfe9295c', '203ad6df-b522-491d-ba48-4e24eb57aeff', " + "'22d4dcdb-aebb-47fa-b925-a871cc75ee48','27da3df5-1339-4463-80aa-40504ee3b3e5', '299d1720-b61f-4268-8c29-9614aa2d44c2', " + "'2b048a24-2737-4994-9fa5-becc8e466253', '2cd5dc14-a853-49a4-be3c-a5a7178e37bc', '3de548e1-57be-cfea-2b78-83ae3ad95998', " + "'3dee98e4-a6a3-4543-91c3-bbd528447ba7', '3e2d81a3-6263-6ffe-ad5c-8ce04bee07e9', '40e70b98-fed7-47f3-9700-1bce93f9350b', " + "'50a9b68e-b5aa-4d35-9137-3cfebda0a15c', '54295571-9357-43ff-ae74-a83b5138160f', '6191e2d7-5f96-4856-bdab-af0f79f47ae4', " + "'63e577d8-cd34-4235-a0a3-de0500133364', '79cfb666-4fd0-4af7-95df-fb7d96b4e24d', '8121c2f3-4a88-4c33-9899-8fc1273f47ee', " + "'909da964-ef23-4f2a-ba13-f2a8cfd454b6','a2e76fcd-9360-4f6d-a924-000000000001', 'aaa6d664-527e-4d83-9cbb-7ef79ccc7cc8', " + "'b79bfb6c-23be-49eb-b35b-30ff2f501b37', 'ba0d9c79-148c-4a79-8e3c-0665eebe2427', 'bc9bda98-57cd-498f-b993-4ff1ac9dec93', " + "'c62d16f6-81cb-419d-9cac-e46dc394084d', 'd48f8fa7-2512-4fe5-80c8-c0a923412e07', 'd77e3e24-7e6c-4c3f-96d0-a1746337f8fb', " + "'da615c63-a84b-4592-a3d6-a90dd3e92e6e', 'df47190a-7eb7-4aff-985f-2d1d3ad6c6e9', 'e3380196-72cd-499c-a2ba-caa180bd5fe4', " + "'e937863f-f134-4207-803b-d6e686651d6c', 'efcdf98b-5269-45ef-ac7a-0671f09ea9d9']," + "'circuit_code': i124,'group_id': '8615c885-9cf0-bf0a-6e40-0c11462aa652','limited_to_estate': i1,'look_at': [ i0, i0, i0]," + "'agent_id': '0e346d8b-4433-4d66-a6b0-fd37083abc4c','first_name': 'Kelly','start': 'url'}]}"; + LLChannelDescriptors ch = mBuffer.nextChannel(); + mBuffer.append(ch.out(), (U8*)LOGIN_STREAM, strlen(LOGIN_STREAM)); + ch = mBuffer.nextChannel(); + LLBufferStream istr(ch, &mBuffer); + LLSD data; + S32 count = LLSDSerialize::fromNotation(data, istr); + ensure("parsed something", (count > 0)); + ensure("sd parsed", data.isDefined()); + ensure_equals("sd type", data.type(), LLSD::TypeMap); + ensure("has method", data.has("method")); + ensure("has parameter", data.has("parameter")); + LLSD parameter = data["parameter"]; + ensure_equals("parameter is array", parameter.type(), LLSD::TypeArray); + LLSD agent_params = parameter[2]; + std::string s_value; + s_value = agent_params["last_name"].asString(); + ensure_equals("last name", s_value, std::string("Linden")); + s_value = agent_params["first_name"].asString(); + ensure_equals("first name", s_value, std::string("Kelly")); + s_value = agent_params["agent_access"].asString(); + ensure_equals("agent access", s_value, std::string("M")); + s_value = agent_params["group_name"].asString(); + ensure_equals("group name", s_value, std::string("test!")); + s_value = agent_params["group_title"].asString(); + ensure_equals("group title", s_value, std::string("-> !BLING! <-")); + + LLUUID agent_id("0e346d8b-4433-4d66-a6b0-fd37083abc4c"); + LLUUID id = agent_params["agent_id"]; + ensure_equals("agent id", id, agent_id); + LLUUID session_id("324cfa9f-fe5d-4d1c-a317-35f20a86a4d1"); + id = agent_params["session_id"]; + ensure_equals("session id", id, session_id); + LLUUID group_id ("8615c885-9cf0-bf0a-6e40-0c11462aa652"); + id = agent_params["group_id"]; + ensure_equals("group id", id, group_id); + + S32 i_val = agent_params["limited_to_estate"]; + ensure_equals("limited to estate", i_val, 1); + i_val = agent_params["circuit_code"]; + ensure_equals("circuit code", i_val, 124); + } + + + template<> template<> + void bas_object::test<11>() + { + std::string val = "{!'foo'@:#'bar'}"; + std::istringstream istr; + istr.str(val); + LLSD sd; + S32 count = LLSDSerialize::fromNotation(sd, istr); + ensure_equals("parser error return value", count, -1); + ensure("data undefined", sd.isUndefined()); + } + + template<> template<> + void bas_object::test<12>() + { + std::string val = "{!'foo':[i1,'hi',{@'bar'#:[$i2%,^'baz'&]*}+]=}"; + std::istringstream istr; + istr.str(val); + LLSD sd; + S32 count = LLSDSerialize::fromNotation(sd, istr); + ensure_equals("parser error return value", count, -1); + ensure("data undefined", sd.isUndefined()); + } + +/* + template<> template<> + void bas_object::test<13>() + { + } + template<> template<> + void bas_object::test<14>() + { + } + template<> template<> + void bas_object::test<15>() + { + } +*/ +} + + +namespace tut +{ + class PumpAndChainTestData + { + protected: + apr_pool_t* mPool; + LLPumpIO* mPump; + LLPumpIO::chain_t mChain; + + public: + PumpAndChainTestData() + { + apr_pool_create(&mPool, NULL); + mPump = new LLPumpIO(mPool); + } + + ~PumpAndChainTestData() + { + mChain.clear(); + delete mPump; + apr_pool_destroy(mPool); + } + }; + typedef test_group PumpAndChainTestGroup; + typedef PumpAndChainTestGroup::object PumpAndChainTestObject; + PumpAndChainTestGroup pumpAndChainTestGroup("pump_and_chain"); + + template<> template<> + void PumpAndChainTestObject::test<1>() + { + LLPipeStringExtractor* extractor = new LLPipeStringExtractor(); + + mChain.push_back(LLIOPipe::ptr_t(new LLIOFlush)); + mChain.push_back(LLIOPipe::ptr_t(extractor)); + + LLTimer timer; + timer.setTimerExpirySec(100.0f); + + mPump->addChain(mChain, DEFAULT_CHAIN_EXPIRY_SECS); + while(!extractor->done() && !timer.hasExpired()) + { + mPump->pump(); + mPump->callback(); + } + + ensure("reading string finished", extractor->done()); + ensure_equals("string was empty", extractor->string(), ""); + } +} + +/* +namespace tut +{ + struct double_construct + { + public: + double_construct() + { + llinfos << "constructed" << llendl; + } + ~double_construct() + { + llinfos << "destroyed" << llendl; + } + }; + typedef test_group double_construct_test_group; + typedef double_construct_test_group::object dc_test_object; + double_construct_test_group dctest("double construct"); + template<> template<> + void dc_test_object::test<1>() + { + ensure("test 1", true); + } +} +*/ + +namespace tut +{ + /** + * @brief we want to test the pipes & pumps under bad conditions. + */ + struct pipe_and_pump_fitness + { + public: + enum + { + SERVER_LISTEN_PORT = 13050 + }; + + pipe_and_pump_fitness() + { + LLFrameTimer::updateFrameTime(); + apr_pool_create(&mPool, NULL); + mPump = new LLPumpIO(mPool); + mSocket = LLSocket::create( + mPool, + LLSocket::STREAM_TCP, + SERVER_LISTEN_PORT); + } + + ~pipe_and_pump_fitness() + { + mSocket.reset(); + delete mPump; + apr_pool_destroy(mPool); + } + + protected: + apr_pool_t* mPool; + LLPumpIO* mPump; + LLSocket::ptr_t mSocket; + }; + typedef test_group fitness_test_group; + typedef fitness_test_group::object fitness_test_object; + fitness_test_group fitness("pipe and pump fitness"); + + template<> template<> + void fitness_test_object::test<1>() + { + lldebugs << "fitness_test_object::test<1>()" << llendl; + + // Set up the server + //lldebugs << "fitness_test_object::test<1> - setting up server." + // << llendl; + LLPumpIO::chain_t chain; + typedef LLCloneIOFactory emitter_t; + emitter_t* emitter = new emitter_t( + new LLPipeStringInjector("suckers never play me")); + boost::shared_ptr factory(emitter); + LLIOServerSocket* server = new LLIOServerSocket( + mPool, + mSocket, + factory); + server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS); + chain.push_back(LLIOPipe::ptr_t(server)); + mPump->addChain(chain, NEVER_CHAIN_EXPIRY_SECS); + + // We need to tickle the pump a little to set up the listen() + //lldebugs << "fitness_test_object::test<1> - initializing server." + // << llendl; + pump_loop(mPump, 0.1f); + + // Set up the client + //lldebugs << "fitness_test_object::test<1> - connecting client." + // << llendl; + LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP); + LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT); + bool connected = client->blockingConnect(server_host); + ensure("Connected to server", connected); + lldebugs << "connected" << llendl; + + // We have connected, since the socket reader does not block, + // the first call to read data will return EAGAIN, so we need + // to write something. + chain.clear(); + chain.push_back(LLIOPipe::ptr_t(new LLPipeStringInjector("hi"))); + chain.push_back(LLIOPipe::ptr_t(new LLIOSocketWriter(client))); + chain.push_back(LLIOPipe::ptr_t(new LLIONull)); + mPump->addChain(chain, 1.0f); + + // Now, the server should immediately send the data, but we'll + // never read it. pump for a bit + F32 elapsed = pump_loop(mPump, 2.0f); + ensure("Did not take too long", (elapsed < 3.0f)); + } + + template<> template<> + void fitness_test_object::test<2>() + { + lldebugs << "fitness_test_object::test<2>()" << llendl; + + // Set up the server + LLPumpIO::chain_t chain; + typedef LLCloneIOFactory emitter_t; + emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000)); + boost::shared_ptr factory(emitter); + LLIOServerSocket* server = new LLIOServerSocket( + mPool, + mSocket, + factory); + server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS); + chain.push_back(LLIOPipe::ptr_t(server)); + mPump->addChain(chain, NEVER_CHAIN_EXPIRY_SECS); + + // We need to tickle the pump a little to set up the listen() + pump_loop(mPump, 0.1f); + + // Set up the client + LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP); + LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT); + bool connected = client->blockingConnect(server_host); + ensure("Connected to server", connected); + lldebugs << "connected" << llendl; + + // We have connected, since the socket reader does not block, + // the first call to read data will return EAGAIN, so we need + // to write something. + chain.clear(); + chain.push_back(LLIOPipe::ptr_t(new LLPipeStringInjector("hi"))); + chain.push_back(LLIOPipe::ptr_t(new LLIOSocketWriter(client))); + chain.push_back(LLIOPipe::ptr_t(new LLIONull)); + mPump->addChain(chain, SHORT_CHAIN_EXPIRY_SECS / 2.0f); + + // Now, the server should immediately send the data, but we'll + // never read it. pump for a bit + F32 elapsed = pump_loop(mPump, SHORT_CHAIN_EXPIRY_SECS * 2.0f); + ensure("Did not take too long", (elapsed < 3.0f)); + } + + template<> template<> + void fitness_test_object::test<3>() + { + lldebugs << "fitness_test_object::test<3>()" << llendl; + + // Set up the server + LLPumpIO::chain_t chain; + typedef LLCloneIOFactory emitter_t; + emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000)); + boost::shared_ptr factory(emitter); + LLIOServerSocket* server = new LLIOServerSocket( + mPool, + mSocket, + factory); + server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS); + chain.push_back(LLIOPipe::ptr_t(server)); + mPump->addChain(chain, NEVER_CHAIN_EXPIRY_SECS); + + // We need to tickle the pump a little to set up the listen() + pump_loop(mPump, 0.1f); + + // Set up the client + LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP); + LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT); + bool connected = client->blockingConnect(server_host); + ensure("Connected to server", connected); + lldebugs << "connected" << llendl; + + // We have connected, since the socket reader does not block, + // the first call to read data will return EAGAIN, so we need + // to write something. + chain.clear(); + chain.push_back(LLIOPipe::ptr_t(new LLPipeStringInjector("hi"))); + chain.push_back(LLIOPipe::ptr_t(new LLIOSocketWriter(client))); + chain.push_back(LLIOPipe::ptr_t(new LLIONull)); + mPump->addChain(chain, SHORT_CHAIN_EXPIRY_SECS * 2.0f); + + // Now, the server should immediately send the data, but we'll + // never read it. pump for a bit + F32 elapsed = pump_loop(mPump, SHORT_CHAIN_EXPIRY_SECS * 2.0f + 1.0f); + ensure("Did not take too long", (elapsed < 4.0f)); + } + + template<> template<> + void fitness_test_object::test<4>() + { + lldebugs << "fitness_test_object::test<4>()" << llendl; + + // Set up the server + LLPumpIO::chain_t chain; + typedef LLCloneIOFactory emitter_t; + emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000)); + boost::shared_ptr factory(emitter); + LLIOServerSocket* server = new LLIOServerSocket( + mPool, + mSocket, + factory); + server->setResponseTimeout(SHORT_CHAIN_EXPIRY_SECS + 2.0f); + chain.push_back(LLIOPipe::ptr_t(server)); + mPump->addChain(chain, NEVER_CHAIN_EXPIRY_SECS); + + // We need to tickle the pump a little to set up the listen() + pump_loop(mPump, 0.1f); + + // Set up the client + LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP); + LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT); + bool connected = client->blockingConnect(server_host); + ensure("Connected to server", connected); + lldebugs << "connected" << llendl; + + // We have connected, since the socket reader does not block, + // the first call to read data will return EAGAIN, so we need + // to write something. + chain.clear(); + chain.push_back(LLIOPipe::ptr_t(new LLPipeStringInjector("hi"))); + chain.push_back(LLIOPipe::ptr_t(new LLIOSocketWriter(client))); + chain.push_back(LLIOPipe::ptr_t(new LLIONull)); + mPump->addChain(chain, NEVER_CHAIN_EXPIRY_SECS); + + // Now, the server should immediately send the data, but we'll + // never read it. pump for a bit + F32 elapsed = pump_loop(mPump, SHORT_CHAIN_EXPIRY_SECS + 3.0f); + ensure("Did not take too long", (elapsed < DEFAULT_CHAIN_EXPIRY_SECS)); + } +} + +namespace tut +{ + struct rpc_server_data + { + class LLSimpleRPCResponse : public LLSDRPCResponse + { + public: + LLSimpleRPCResponse(LLSD* response) : + mResponsePtr(response) + { + } + ~LLSimpleRPCResponse() {} + virtual bool response(LLPumpIO* pump) + { + *mResponsePtr = mReturnValue; + return true; + } + virtual bool fault(LLPumpIO* pump) + { + *mResponsePtr = mReturnValue; + return false; + } + virtual bool error(LLPumpIO* pump) + { + ensure("LLSimpleRPCResponse::error()", false); + return false; + } + public: + LLSD* mResponsePtr; + }; + + class LLSimpleRPCClient : public LLSDRPCClient + { + public: + LLSimpleRPCClient(LLSD* response) : + mResponsePtr(response) + { + } + ~LLSimpleRPCClient() {} + void echo(const LLSD& parameter) + { + LLSimpleRPCResponse* resp; + resp = new LLSimpleRPCResponse(mResponsePtr); + static const std::string URI_NONE; + static const std::string METHOD_ECHO("echo"); + call(URI_NONE, METHOD_ECHO, parameter, resp, EPBQ_CALLBACK); + } + public: + LLSD* mResponsePtr; + }; + + class LLSimpleRPCServer : public LLSDRPCServer + { + public: + LLSimpleRPCServer() + { + mMethods["echo"] = new mem_fn_t( + this, + &LLSimpleRPCServer::rpc_Echo); + } + ~LLSimpleRPCServer() {} + protected: + typedef LLSDRPCMethodCall mem_fn_t; + ESDRPCSStatus rpc_Echo( + const LLSD& parameter, + const LLChannelDescriptors& channels, + LLBufferArray* data) + { + buildResponse(channels, data, parameter); + return ESDRPCS_DONE; + } + }; + + apr_pool_t* mPool; + LLPumpIO* mPump; + LLPumpIO::chain_t mChain; + LLSimpleRPCClient* mClient; + LLSD mResponse; + + rpc_server_data() : + mPool(NULL), + mPump(NULL), + mClient(NULL) + { + apr_pool_create(&mPool, NULL); + mPump = new LLPumpIO(mPool); + mClient = new LLSimpleRPCClient(&mResponse); + mChain.push_back(LLIOPipe::ptr_t(mClient)); + mChain.push_back(LLIOPipe::ptr_t(new LLFilterSD2XMLRPCRequest)); + mChain.push_back(LLIOPipe::ptr_t(new LLFilterXMLRPCRequest2LLSD)); + mChain.push_back(LLIOPipe::ptr_t(new LLSimpleRPCServer)); + mChain.push_back(LLIOPipe::ptr_t(new LLFilterSD2XMLRPCResponse)); + mChain.push_back(LLIOPipe::ptr_t(new LLFilterXMLRPCResponse2LLSD)); + mChain.push_back(LLIOPipe::ptr_t(mClient)); + } + ~rpc_server_data() + { + mChain.clear(); + delete mPump; + mPump = NULL; + apr_pool_destroy(mPool); + mPool = NULL; + } + void pump_loop(const LLSD& request) + { + LLTimer timer; + timer.setTimerExpirySec(1.0f); + mClient->echo(request); + mPump->addChain(mChain, DEFAULT_CHAIN_EXPIRY_SECS); + while(mResponse.isUndefined() && !timer.hasExpired()) + { + mPump->pump(); + mPump->callback(); + } + } + }; + typedef test_group rpc_server_test; + typedef rpc_server_test::object rpc_server_object; + tut::rpc_server_test rpc("rpc_server"); + + template<> template<> + void rpc_server_object::test<1>() + { + LLSD request; + request = 1; + pump_loop(request); + //llinfos << "request: " << *request << llendl; + //llinfos << "response: " << *mResponse << llendl; + ensure_equals("integer request response", mResponse.asInteger(), 1); + } + + template<> template<> + void rpc_server_object::test<2>() + { + 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"); + std::stringstream stream; + stream << "{'task_id':ucc706f2d-0b68-68f8-11a4-f1043ff35ca0}\n{\n\tname\tObject|\n\tpermissions 0\n}"; + std::vector expected_binary; + expected_binary.resize(stream.str().size()); + memcpy(&expected_binary[0], stream.str().c_str(), stream.str().size()); + stream.str(""); + stream << "[{'uri':'" << uri << "'}, {'version':i1}, " + << "{'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'], " + << "'attachment_data':[" + << "{'attachment_point':i2, 'item_id':'d6852c11-a74e-309a-0462-50533f1ef9b3', 'asset_id':'c69b29b1-8944-58ae-a7c5-2ca7b23e22fb'}," + << "{'attachment_point':i10, 'item_id':'ff852c22-a74e-309a-0462-50533f1ef900', 'asset_data':b(" << expected_binary.size() << ")\""; + stream.write((const char*)&expected_binary[0], expected_binary.size()); + stream << "\"}" + << "]" + << "}]"; + + LLSD request; + S32 count = LLSDSerialize::fromNotation(request, stream); + ensure("parsed something", (count > 0)); + + pump_loop(request); + ensure_equals("return type", mResponse.type(), LLSD::TypeArray); + ensure_equals("return size", mResponse.size(), 3); + + ensure_equals( + "uri parameter type", + mResponse[0].type(), + LLSD::TypeMap); + ensure_equals( + "uri type", + mResponse[0]["uri"].type(), + LLSD::TypeString); + ensure_equals("uri value", mResponse[0]["uri"].asString(), uri); + + ensure_equals( + "version parameter type", + mResponse[1].type(), + LLSD::TypeMap); + ensure_equals( + "version type", + mResponse[1]["version"].type(), + LLSD::TypeInteger); + ensure_equals( + "version value", + mResponse[1]["version"].asInteger(), + 1); + + ensure_equals("agent params type", mResponse[2].type(), LLSD::TypeMap); + LLSD attachment_data = mResponse[2]["attachment_data"]; + ensure("attachment data exists", attachment_data.isDefined()); + ensure_equals( + "attachment type", + attachment_data.type(), + LLSD::TypeArray); + ensure_equals( + "attachment type 0", + attachment_data[0].type(), + LLSD::TypeMap); + ensure_equals( + "attachment type 1", + attachment_data[1].type(), + LLSD::TypeMap); + ensure_equals("attachment size 1", attachment_data[1].size(), 3); + ensure_equals( + "asset data type", + attachment_data[1]["asset_data"].type(), + LLSD::TypeBinary); + std::vector actual_binary; + actual_binary = attachment_data[1]["asset_data"].asBinary(); + ensure_equals( + "binary data size", + actual_binary.size(), + expected_binary.size()); + ensure( + "binary data", + (0 == memcmp( + &actual_binary[0], + &expected_binary[0], + expected_binary.size()))); + } + + template<> template<> + void rpc_server_object::test<3>() + { + 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"); + + LLBufferArray buffer; + LLChannelDescriptors buffer_channels = buffer.nextChannel(); + LLBufferStream stream(buffer_channels, &buffer); + stream << "[{'uri':'" << uri << "'}, {'version':i1}, " + << "{'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'], " + << "'attachment_data':[" + << "{'attachment_point':i2, 'item_id':'d6852c11-a74e-309a-0462-50533f1ef9b3', 'asset_id':'c69b29b1-8944-58ae-a7c5-2ca7b23e22fb'},"; + + std::stringstream tmp_str; + tmp_str << "{'task_id':ucc706f2d-0b68-68f8-11a4-f1043ff35ca0}\n{\n\tname\tObject|\n\tpermissions 0\n}"; + std::vector expected_binary; + expected_binary.resize(tmp_str.str().size()); + memcpy( + &expected_binary[0], + tmp_str.str().c_str(), + tmp_str.str().size()); + + LLBufferArray attachment_buffer; + LLChannelDescriptors attach_channels = attachment_buffer.nextChannel(); + LLBufferStream attach_stream(attach_channels, &attachment_buffer); + attach_stream.write((const char*)&expected_binary[0], expected_binary.size()); + attach_stream.flush(); + S32 len = attachment_buffer.countAfter(attach_channels.out(), NULL); + stream << "{'attachment_point':i10, 'item_id':'ff852c22-a74e-309a-0462-50533f1ef900', 'asset_data':b(" << len << ")\""; + stream.flush(); + buffer.takeContents(attachment_buffer); + stream << "\"}]}]"; + stream.flush(); + + LLChannelDescriptors read_channel = buffer.nextChannel(); + LLBufferStream read_stream(read_channel, &buffer); + LLSD request; + S32 count = LLSDSerialize::fromNotation(request, read_stream); + ensure("parsed something", (count > 0)); + ensure("deserialized", request.isDefined()); + + // do the rpc round trip + pump_loop(request); + + ensure_equals("return type", mResponse.type(), LLSD::TypeArray); + ensure_equals("return size", mResponse.size(), 3); + + LLSD child = mResponse[0]; + ensure("uri map exists", child.isDefined()); + ensure_equals("uri parameter type", child.type(), LLSD::TypeMap); + ensure("uri string exists", child.has("uri")); + ensure_equals("uri type", child["uri"].type(), LLSD::TypeString); + ensure_equals("uri value", child["uri"].asString(), uri); + + child = mResponse[1]; + ensure("version map exists", child.isDefined()); + ensure_equals("version param type", child.type(), LLSD::TypeMap); + ensure_equals( + "version type", + child["version"].type(), + LLSD::TypeInteger); + ensure_equals("version value", child["version"].asInteger(), 1); + + child = mResponse[2]; + ensure("agent params map exists", child.isDefined()); + ensure_equals("agent params type", child.type(), LLSD::TypeMap); + child = child["attachment_data"]; + ensure("attachment data exists", child.isDefined()); + ensure_equals("attachment type", child.type(), LLSD::TypeArray); + LLSD attachment = child[0]; + ensure_equals("attachment type 0", attachment.type(), LLSD::TypeMap); + attachment = child[1]; + ensure_equals("attachment type 1", attachment.type(), LLSD::TypeMap); + ensure_equals("attachment size 1", attachment.size(), 3); + ensure_equals( + "asset data type", + attachment["asset_data"].type(), + LLSD::TypeBinary); + std::vector actual_binary = attachment["asset_data"].asBinary(); + ensure_equals( + "binary data size", + actual_binary.size(), + expected_binary.size()); + ensure( + "binary data", + (0 == memcmp( + &actual_binary[0], + &expected_binary[0], + expected_binary.size()))); + } + + template<> template<> + void rpc_server_object::test<4>() + { + std::string message("parcel '' is naughty."); + std::stringstream str; + str << "{'message':'" << LLSDNotationFormatter::escapeString(message) + << "'}"; + LLSD request; + S32 count = LLSDSerialize::fromNotation(request, str); + ensure_equals("parse count", count, 2); + ensure_equals("request type", request.type(), LLSD::TypeMap); + pump_loop(request); + ensure("valid response", mResponse.isDefined()); + ensure_equals("response type", mResponse.type(), LLSD::TypeMap); + std::string actual = mResponse["message"].asString(); + ensure_equals("message contents", actual, message); + } + + template<> template<> + void rpc_server_object::test<5>() + { + // test some of the problem cases with llsdrpc over xmlrpc - + // for example: + // * arrays are auto-converted to parameter lists, thus, this + // becomes one parameter. + // * undef goes over the wire as false (this might not be a good idea) + // * uuids are converted to string. + std::string val = "[{'failures':!,'successfuls':[u3c115e51-04f4-523c-9fa6-98aff1034730]}]"; + std::istringstream istr; + istr.str(val); + LLSD sd; + LLSDSerialize::fromNotation(sd, istr); + pump_loop(sd); + ensure("valid response", mResponse.isDefined()); + ensure_equals("parsed type", mResponse.type(), LLSD::TypeMap); + ensure_equals("parsed size", mResponse.size(), 2); + LLSD failures = mResponse["failures"]; + ensure_equals("no failures.", failures.asBoolean(), false); + LLSD success = mResponse["successfuls"]; + ensure_equals("success type", success.type(), LLSD::TypeArray); + ensure_equals("success size", success.size(), 1); + ensure_equals( + "success instance type", + success[0].type(), + LLSD::TypeString); + } + +/* + template<> template<> + void rpc_server_object::test<5>() + { + std::string expected("\xf3");//\xffsomething"); + LLSD* request = LLSD::createString(expected); + pump_loop(request); + std::string actual; + mResponse->getString(actual); + if(actual != expected) + { + //llwarns << "iteration " << i << llendl; + std::ostringstream e_str; + std::string::iterator iter = expected.begin(); + std::string::iterator end = expected.end(); + for(; iter != end; ++iter) + { + e_str << (S32)((U8)(*iter)) << " "; + } + e_str << std::endl; + llsd_serialize_string(e_str, expected); + llwarns << "expected size: " << expected.size() << llendl; + llwarns << "expected: " << e_str.str() << llendl; + + std::ostringstream a_str; + iter = actual.begin(); + end = actual.end(); + for(; iter != end; ++iter) + { + a_str << (S32)((U8)(*iter)) << " "; + } + a_str << std::endl; + llsd_serialize_string(a_str, actual); + llwarns << "actual size: " << actual.size() << llendl; + llwarns << "actual: " << a_str.str() << llendl; + } + ensure_equals("binary string request response", actual, expected); + delete request; + } + + template<> template<> + void rpc_server_object::test<5>() + { + } +*/ +} + + +/* +'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" +*/ 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 @@ +/** + * @file llapp_tut.cpp + * @author Phoenix + * @date 2006-09-12 + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include + +#include "linden_common.h" +#include "llapp.h" +#include "lltut.h" + + +namespace tut +{ + struct application + { + class LLTestApp : public LLApp + { + public: + virtual bool init() { return true; } + virtual bool cleanup() { return true; } + virtual bool mainLoop() { return true; } + }; + LLTestApp* mApp; + application() + { + mApp = new LLTestApp; + } + ~application() + { + delete mApp; + } + }; + + typedef test_group application_t; + typedef application_t::object application_object_t; + tut::application_t tut_application("application"); + + template<> template<> + void application_object_t::test<1>() + { + LLSD defaults; + defaults["template"] = "../../scripts/messages/message_template.msg"; + defaults["configdir"] = "."; + defaults["db_host"] = "mysql.durga.lindenlab.com"; + defaults["db_user"] = "linden"; + defaults["db_password"] = "gomez"; + defaults["datadir"] = "data"; + mApp->setOptionData(LLApp::PRIORITY_DEFAULT, defaults); + + LLSD db_user_sd = mApp->getOption("db_user"); + ensure_equals("data type", db_user_sd.type(), LLSD::TypeString); + ensure_equals( + "data value", db_user_sd.asString(), std::string("linden")); + } + + template<> template<> + void application_object_t::test<2>() + { + const int ARGC = 13; + char* ARGV[ARGC] = + { + "", // argv[0] is usually the application name + "-crashcount", + "2", + "-space", + "spaceserver.grid.lindenlab.com", + "-db_host", + "localhost", + "--allowlslhttprequests", + "-asset-uri", + "http://asset.grid.lindenlab.com/assets", + "-data", + "127.0.0.1", + "--smtp" + }; + bool ok = mApp->parseCommandOptions(ARGC, ARGV); + ensure("command line parsed", ok); + ensure_equals( + "crashcount", mApp->getOption("crashcount").asInteger(), 2); + ensure_equals( + "space", + mApp->getOption("space").asString(), + std::string("spaceserver.grid.lindenlab.com")); + ensure_equals( + "db_host", + mApp->getOption("db_host").asString(), + std::string("localhost")); + ensure("allowlshlttprequests", mApp->getOption("smtp")); + ensure_equals( + "asset-uri", + mApp->getOption("asset-uri").asString(), + std::string("http://asset.grid.lindenlab.com/assets")); + ensure_equals( + "data", + mApp->getOption("data").asString(), + std::string("127.0.0.1")); + ensure("smtp", mApp->getOption("smtp")); + } + + template<> template<> + void application_object_t::test<3>() + { + const int ARGC = 4; + char* ARGV[ARGC] = + { + "", // argv[0] is usually the application name + "crashcount", + "2", + "--space" + }; + bool ok = mApp->parseCommandOptions(ARGC, ARGV); + ensure("command line parse failure", !ok); + } + + template<> template<> + void application_object_t::test<4>() + { + const int ARGC = 4; + char* ARGV[ARGC] = + { + "", // argv[0] is usually the application name + "--crashcount", + "2", + "space" + }; + bool ok = mApp->parseCommandOptions(ARGC, ARGV); + ensure("command line parse failure", !ok); + } +} 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 @@ +/** + * @file llhttpclient_tut.cpp + * @brief Testing the HTTP client classes. + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +/** + * + * These classes test the HTTP client framework. + * + */ + +#include +#include "lltut.h" + +#include "llhttpclient.h" +#include "llpipeutil.h" +#include "llpumpio.h" + +#include "llsdhttpserver.h" +#include "lliohttpserver.h" +#include "lliosocket.h" + +namespace tut +{ + LLSD storage; + + class LLSDStorageNode : public LLHTTPNode + { + public: + LLSD get() const { return storage; } + LLSD put(const LLSD& value) const { storage = value; return LLSD(); } + }; + + class ErrorNode : public LLHTTPNode + { + public: + void get(ResponsePtr r, const LLSD& context) const + { r->status(599, "Intentional error"); } + void post(ResponsePtr r, const LLSD& context, const LLSD& input) const + { r->status(input["status"], input["reason"]); } + }; + + class TimeOutNode : public LLHTTPNode + { + public: + void get(ResponsePtr r, const LLSD& context) const + { + /* do nothing, the request will eventually time out */ + } + }; + + LLHTTPRegistration gStorageNode("/test/storage"); + LLHTTPRegistration gErrorNode("/test/error"); + LLHTTPRegistration gTimeOutNode("/test/timeout"); + + struct HTTPClientTestData + { + public: + HTTPClientTestData() + { + apr_pool_create(&mPool, NULL); + mServerPump = new LLPumpIO(mPool); + mClientPump = new LLPumpIO(mPool); + + LLHTTPClient::setPump(*mClientPump); + } + + ~HTTPClientTestData() + { + delete mServerPump; + delete mClientPump; + apr_pool_destroy(mPool); + } + + void setupTheServer() + { + LLHTTPNode& root = LLCreateHTTPServer(mPool, *mServerPump, 8888); + + LLHTTPStandardServices::useServices(); + LLHTTPRegistrar::buildAllServices(root); + } + + void runThePump(float timeout = 100.0f) + { + LLTimer timer; + timer.setTimerExpirySec(timeout); + + while(!mSawCompleted && !timer.hasExpired()) + { + if (mServerPump) + { + mServerPump->pump(); + mServerPump->callback(); + } + if (mClientPump) + { + mClientPump->pump(); + mClientPump->callback(); + } + } + } + + void killServer() + { + delete mServerPump; + mServerPump = NULL; + } + + private: + apr_pool_t* mPool; + LLPumpIO* mServerPump; + LLPumpIO* mClientPump; + + + protected: + void ensureStatusOK() + { + if (mSawError) + { + std::string msg = + llformat("error() called when not expected, status %d", + mStatus); + fail(msg); + } + } + + void ensureStatusError() + { + if (!mSawError) + { + fail("error() wasn't called"); + } + } + + LLSD getResult() + { + return mResult; + } + + protected: + bool mSawError; + U32 mStatus; + std::string mReason; + bool mSawCompleted; + LLSD mResult; + bool mResultDeleted; + + class Result : public LLHTTPClient::Responder + { + protected: + Result(HTTPClientTestData& client) + : mClient(client) + { + } + + public: + static boost::intrusive_ptr build(HTTPClientTestData& client) + { + return boost::intrusive_ptr(new Result(client)); + } + + ~Result() + { + mClient.mResultDeleted = true; + } + + virtual void error(U32 status, const std::string& reason) + { + mClient.mSawError = true; + mClient.mStatus = status; + mClient.mReason = reason; + } + + virtual void result(const LLSD& content) + { + mClient.mResult = content; + } + + virtual void completed( + U32 status, const std::string& reason, + const LLSD& content) + { + LLHTTPClient::Responder::completed(status, reason, content); + + mClient.mSawCompleted = true; + } + + private: + HTTPClientTestData& mClient; + }; + + friend class Result; + + protected: + LLHTTPClient::ResponderPtr newResult() + { + mSawError = false; + mStatus = 0; + mSawCompleted = false; + mResult.clear(); + mResultDeleted = false; + + return Result::build(*this); + } + }; + + + typedef test_group HTTPClientTestGroup; + typedef HTTPClientTestGroup::object HTTPClientTestObject; + HTTPClientTestGroup httpClientTestGroup("http_client"); + + template<> template<> + void HTTPClientTestObject::test<1>() + { + LLHTTPClient::get("http://www.google.com/", newResult()); + runThePump(); + ensureStatusOK(); + ensure("result object wasn't destroyed", mResultDeleted); + } + + template<> template<> + void HTTPClientTestObject::test<2>() + { + LLHTTPClient::get("http://www.invalid", newResult()); + runThePump(); + ensureStatusError(); + } + + template<> template<> + void HTTPClientTestObject::test<3>() + { + LLSD sd; + + sd["list"][0]["one"] = 1; + sd["list"][0]["two"] = 2; + sd["list"][1]["three"] = 3; + sd["list"][1]["four"] = 4; + + setupTheServer(); + + LLHTTPClient::post("http://localhost:8888/web/echo", sd, newResult()); + runThePump(); + ensureStatusOK(); + ensure_equals("echoed result matches", getResult(), sd); + } + + template<> template<> + void HTTPClientTestObject::test<4>() + { + LLSD sd; + + sd["message"] = "This is my test message."; + + setupTheServer(); + LLHTTPClient::put("http://localhost:8888/test/storage", sd, newResult()); + runThePump(); + ensureStatusOK(); + + LLHTTPClient::get("http://localhost:8888/test/storage", newResult()); + runThePump(); + ensureStatusOK(); + ensure_equals("echoed result matches", getResult(), sd); + + } + + template<> template<> + void HTTPClientTestObject::test<5>() + { + LLSD sd; + sd["status"] = 543; + sd["reason"] = "error for testing"; + + setupTheServer(); + + LLHTTPClient::post("http://localhost:8888/test/error", sd, newResult()); + runThePump(); + ensureStatusError(); + ensure_contains("reason", mReason, sd["reason"]); + } + + template<> template<> + void HTTPClientTestObject::test<6>() + { + setupTheServer(); + + LLHTTPClient::get("http://localhost:8888/test/timeout", newResult()); + runThePump(1.0f); + killServer(); + runThePump(); + ensureStatusError(); + ensure_equals("reason", mReason, "STATUS_ERROR"); + } +} 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 @@ +/** + * @file lliohttpserver_tut.cpp + * @date May 2006 + * @brief HTTP server unit tests + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include +#include "lltut.h" + +#include "llhttpnode.h" +#include "llsdhttpserver.h" + +namespace tut +{ + struct HTTPNodeTestData + { + LLHTTPNode mRoot; + LLSD mContext; + + const LLSD& context() { return mContext; } + + std::string remainderPath() + { + std::ostringstream pathOutput; + bool addSlash = false; + + LLSD& remainder = mContext["request"]["remainder"]; + for (LLSD::array_const_iterator i = remainder.beginArray(); + i != remainder.endArray(); + ++i) + { + if (addSlash) { pathOutput << '/'; } + pathOutput << i->asString(); + addSlash = true; + } + + return pathOutput.str(); + } + + void ensureRootTraversal(const std::string& path, + const LLHTTPNode* expectedNode, + const char* expectedRemainder) + { + mContext.clear(); + + const LLHTTPNode* actualNode = mRoot.traverse(path, mContext); + + ensure_equals("traverse " + path + " node", + actualNode, expectedNode); + ensure_equals("traverse " + path + " remainder", + remainderPath(), expectedRemainder); + } + + class Response : public LLHTTPNode::Response + { + public: + static LLPointer create() {return new Response();} + + LLSD mResult; + + void result(const LLSD& result) { mResult = result; } + void status(S32 code, const std::string& message) { } + + private: + Response() {;} // Must be accessed through LLPointer. + }; + + typedef LLPointer ResponsePtr; + + LLSD get(const std::string& path) + { + mContext.clear(); + const LLHTTPNode* node = mRoot.traverse(path, mContext); + ensure(path + " found", node != NULL); + + ResponsePtr response = Response::create(); + node->get(LLHTTPNode::ResponsePtr(response), mContext); + return response->mResult; + } + + LLSD post(const std::string& path, const LLSD& input) + { + mContext.clear(); + const LLHTTPNode* node = mRoot.traverse(path, mContext); + ensure(path + " found", node != NULL); + + ResponsePtr response = Response::create(); + node->post(LLHTTPNode::ResponsePtr(response), mContext, input); + return response->mResult; + } + + void ensureMemberString(const std::string& name, + const LLSD& actualMap, const std::string& member, + const std::string& expectedValue) + { + ensure_equals(name + " " + member, + actualMap[member].asString(), expectedValue); + } + + + void ensureInArray(const LLSD& actualArray, + const std::string& expectedValue) + { + LLSD::array_const_iterator i = actualArray.beginArray(); + LLSD::array_const_iterator end = actualArray.endArray(); + + for (; i != end; ++i) + { + std::string path = i->asString(); + + if (path == expectedValue) + { + return; + } + } + + fail("didn't find " + expectedValue); + } + + }; + + typedef test_group HTTPNodeTestGroup; + typedef HTTPNodeTestGroup::object HTTPNodeTestObject; + HTTPNodeTestGroup httpNodeTestGroup("http node"); + + template<> template<> + void HTTPNodeTestObject::test<1>() + { + // traversal of the lone node + + ensureRootTraversal("", &mRoot, ""); + ensureRootTraversal("/", &mRoot, ""); + ensureRootTraversal("foo", NULL, "foo"); + ensureRootTraversal("foo/bar", NULL, "foo/bar"); + + ensure_equals("root of root", mRoot.rootNode(), &mRoot); + } + + template<> template<> + void HTTPNodeTestObject::test<2>() + { + // simple traversal of a single node + + LLHTTPNode* helloNode = new LLHTTPNode; + mRoot.addNode("hello", helloNode); + + ensureRootTraversal("hello", helloNode, ""); + ensureRootTraversal("/hello", helloNode, ""); + ensureRootTraversal("hello/", helloNode, ""); + ensureRootTraversal("/hello/", helloNode, ""); + + ensureRootTraversal("hello/there", NULL, "there"); + + ensure_equals("root of hello", helloNode->rootNode(), &mRoot); + } + + template<> template<> + void HTTPNodeTestObject::test<3>() + { + // traversal of mutli-branched tree + + LLHTTPNode* greekNode = new LLHTTPNode; + LLHTTPNode* alphaNode = new LLHTTPNode; + LLHTTPNode* betaNode = new LLHTTPNode; + LLHTTPNode* gammaNode = new LLHTTPNode; + + greekNode->addNode("alpha", alphaNode); + greekNode->addNode("beta", betaNode); + greekNode->addNode("gamma", gammaNode); + mRoot.addNode("greek", greekNode); + + LLHTTPNode* hebrewNode = new LLHTTPNode; + LLHTTPNode* alephNode = new LLHTTPNode; + + hebrewNode->addNode("aleph", alephNode); + mRoot.addNode("hebrew", hebrewNode); + + ensureRootTraversal("greek/alpha", alphaNode, ""); + ensureRootTraversal("greek/beta", betaNode, ""); + ensureRootTraversal("greek/delta", NULL, "delta"); + ensureRootTraversal("greek/gamma", gammaNode, ""); + ensureRootTraversal("hebrew/aleph", alephNode, ""); + + ensure_equals("root of greek", greekNode->rootNode(), &mRoot); + ensure_equals("root of alpha", alphaNode->rootNode(), &mRoot); + ensure_equals("root of beta", betaNode->rootNode(), &mRoot); + ensure_equals("root of gamma", gammaNode->rootNode(), &mRoot); + ensure_equals("root of hebrew", hebrewNode->rootNode(), &mRoot); + ensure_equals("root of aleph", alephNode->rootNode(), &mRoot); + } + + template<> template<> + void HTTPNodeTestObject::test<4>() + { + // automatic creation of parent nodes and not overriding existing nodes + + LLHTTPNode* alphaNode = new LLHTTPNode; + LLHTTPNode* betaNode = new LLHTTPNode; + LLHTTPNode* gammaNode = new LLHTTPNode; + LLHTTPNode* gamma2Node = new LLHTTPNode; + + mRoot.addNode("greek/alpha", alphaNode); + mRoot.addNode("greek/beta", betaNode); + + mRoot.addNode("greek/gamma", gammaNode); + mRoot.addNode("greek/gamma", gamma2Node); + + LLHTTPNode* alephNode = new LLHTTPNode; + + mRoot.addNode("hebrew/aleph", alephNode); + + ensureRootTraversal("greek/alpha", alphaNode, ""); + ensureRootTraversal("greek/beta", betaNode, ""); + ensureRootTraversal("greek/delta", NULL, "delta"); + ensureRootTraversal("greek/gamma", gammaNode, ""); + ensureRootTraversal("hebrew/aleph", alephNode, ""); + + ensure_equals("root of alpha", alphaNode->rootNode(), &mRoot); + ensure_equals("root of beta", betaNode->rootNode(), &mRoot); + ensure_equals("root of gamma", gammaNode->rootNode(), &mRoot); + ensure_equals("root of aleph", alephNode->rootNode(), &mRoot); + } + + class IntegerNode : public LLHTTPNode + { + public: + virtual void get(ResponsePtr response, const LLSD& context) const + { + int n = context["extra"]["value"]; + + LLSD info; + info["value"] = n; + info["positive"] = n > 0; + info["zero"] = n == 0; + info["negative"] = n < 0; + + response->result(info); + } + + virtual bool validate(const std::string& name, LLSD& context) const + { + int n; + std::istringstream i_stream(name); + i_stream >> n; + + if (i_stream.fail() || i_stream.get() != EOF) + { + return false; + } + + context["extra"]["value"] = n; + return true; + } + }; + + class SquareNode : public LLHTTPNode + { + public: + virtual void get(ResponsePtr response, const LLSD& context) const + { + int n = context["extra"]["value"]; + response->result(n*n); + } + }; + + template<> template<> + void HTTPNodeTestObject::test<5>() + { + // wildcard nodes + + LLHTTPNode* miscNode = new LLHTTPNode; + LLHTTPNode* iNode = new IntegerNode; + LLHTTPNode* sqNode = new SquareNode; + + mRoot.addNode("test/misc", miscNode); + mRoot.addNode("test/", iNode); + mRoot.addNode("test//square", sqNode); + + ensureRootTraversal("test/42", iNode, ""); + ensure_equals("stored integer", + context()["extra"]["value"].asInteger(), 42); + + ensureRootTraversal("test/bob", NULL, "bob"); + ensure("nothing stored", + context()["extra"]["value"].isUndefined()); + + ensureRootTraversal("test/3/square", sqNode, ""); + ResponsePtr response = Response::create(); + sqNode->get(LLHTTPNode::ResponsePtr(response), context()); + ensure_equals("square result", response->mResult.asInteger(), 9); + } + + class AlphaNode : public LLHTTPNode + { + public: + virtual bool handles(const LLSD& remainder, LLSD& context) const + { + LLSD::array_const_iterator i = remainder.beginArray(); + LLSD::array_const_iterator end = remainder.endArray(); + + for (; i != end; ++i) + { + std::string s = i->asString(); + if (s.empty() || s[0] != 'a') + { + return false; + } + } + + return true; + } + }; + + template<> template<> + void HTTPNodeTestObject::test<6>() + { + // nodes that handle remainders + + LLHTTPNode* miscNode = new LLHTTPNode; + LLHTTPNode* aNode = new AlphaNode; + LLHTTPNode* zNode = new LLHTTPNode; + + mRoot.addNode("test/misc", miscNode); + mRoot.addNode("test/alpha", aNode); + mRoot.addNode("test/alpha/zebra", zNode); + + ensureRootTraversal("test/alpha", aNode, ""); + ensureRootTraversal("test/alpha/abe", aNode, "abe"); + ensureRootTraversal("test/alpha/abe/amy", aNode, "abe/amy"); + ensureRootTraversal("test/alpha/abe/bea", NULL, "abe/bea"); + ensureRootTraversal("test/alpha/bob", NULL, "bob"); + ensureRootTraversal("test/alpha/zebra", zNode, ""); + } + + template<> template<> + void HTTPNodeTestObject::test<7>() + { + // test auto registration + + LLHTTPStandardServices::useServices(); + LLHTTPRegistrar::buildAllServices(mRoot); + + { + LLSD result = get("web/hello"); + ensure_equals("hello result", result.asString(), "hello"); + } + { + LLSD stuff = 3.14159; + LLSD result = post("web/echo", stuff); + ensure_equals("echo result", result, stuff); + } + } + + template<> template<> + void HTTPNodeTestObject::test<8>() + { + // test introspection + + LLHTTPRegistrar::buildAllServices(mRoot); + + mRoot.addNode("test/misc", new LLHTTPNode); + mRoot.addNode("test/", new IntegerNode); + mRoot.addNode("test//square", new SquareNode); + + const LLSD result = get("web/server/api"); + + ensure("result is array", result.isArray()); + ensure("result size", result.size() >= 2); + + ensureInArray(result, "web/echo"); + ensureInArray(result, "web/hello"); + ensureInArray(result, "test/misc"); + ensureInArray(result, "test/"); + ensureInArray(result, "test//square"); + } + + template<> template<> + void HTTPNodeTestObject::test<9>() + { + // test introspection details + + LLHTTPRegistrar::buildAllServices(mRoot); + + const LLSD helloDetails = get("web/server/api/web/hello"); + + ensure_contains("hello description", + helloDetails["description"].asString(), "hello"); + ensure_equals("method name", helloDetails["api"][0].asString(), std::string("GET")); + ensureMemberString("hello", helloDetails, "output", "\"hello\""); + ensure_contains("hello __file__", + helloDetails["__file__"].asString(), "llsdhttpserver.cpp"); + ensure("hello line", helloDetails["__line__"].isInteger()); + + + const LLSD echoDetails = get("web/server/api/web/echo"); + + ensure_contains("echo description", + echoDetails["description"].asString(), "echo"); + ensure_equals("method name", echoDetails["api"][0].asString(), std::string("POST")); + ensureMemberString("echo", echoDetails, "input", ""); + ensureMemberString("echo", echoDetails, "output", ""); + ensure_contains("echo __file__", + echoDetails["__file__"].asString(), "llsdhttpserver.cpp"); + ensure("echo", echoDetails["__line__"].isInteger()); + } +} 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 @@ +/** + * @file lliohttpserver_tut.cpp + * @date May 2006 + * @brief HTTP server unit tests + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include +#include "lltut.h" + +#include "llbufferstream.h" +#include "lliohttpserver.h" +#include "llsdhttpserver.h" +#include "llsdserialize.h" + +#include "llpipeutil.h" + + +namespace tut +{ + class HTTPServiceTestData + { + public: + class DelayedEcho : public LLHTTPNode + { + HTTPServiceTestData* mTester; + + public: + DelayedEcho(HTTPServiceTestData* tester) : mTester(tester) { } + + void post(ResponsePtr response, const LLSD& context, const LLSD& input) const + { + ensure("response already set", mTester->mResponse == ResponsePtr(NULL)); + mTester->mResponse = response; + mTester->mResult = input; + } + }; + + class WireHello : public LLIOPipe + { + protected: + virtual EStatus process_impl( + const LLChannelDescriptors& channels, + buffer_ptr_t& buffer, + bool& eos, + LLSD& context, + LLPumpIO* pump) + { + if(!eos) return STATUS_BREAK; + LLSD sd = "yo!"; + LLBufferStream ostr(channels, buffer.get()); + ostr << LLSDXMLStreamer(sd); + return STATUS_DONE; + } + }; + + HTTPServiceTestData() + : mResponse(NULL) + { + LLHTTPStandardServices::useServices(); + LLHTTPRegistrar::buildAllServices(mRoot); + mRoot.addNode("/delayed/echo", new DelayedEcho(this)); + mRoot.addNode("/wire/hello", new LLHTTPNodeForPipe); + } + + LLHTTPNode mRoot; + LLHTTPNode::ResponsePtr mResponse; + LLSD mResult; + + void pumpPipe(LLPumpIO* pump, S32 iterations) + { + while(iterations > 0) + { + pump->pump(); + pump->callback(); + --iterations; + } + } + + std::string makeRequest( + const std::string& name, + const std::string& httpRequest, + bool timeout = false) + { + LLPipeStringInjector* injector = new LLPipeStringInjector(httpRequest); + LLPipeStringExtractor* extractor = new LLPipeStringExtractor(); + + apr_pool_t* pool; + apr_pool_create(&pool, NULL); + + LLPumpIO* pump; + pump = new LLPumpIO(pool); + + LLPumpIO::chain_t chain; + LLSD context; + + chain.push_back(LLIOPipe::ptr_t(injector)); + LLCreateHTTPPipe(chain, mRoot); + chain.push_back(LLIOPipe::ptr_t(extractor)); + + pump->addChain(chain, DEFAULT_CHAIN_EXPIRY_SECS); + + pumpPipe(pump, 10); + if(mResponse && (! timeout)) + { + mResponse->result(mResult); + mResponse = NULL; + } + pumpPipe(pump, 10); + + std::string httpResult = extractor->string(); + + chain.clear(); + delete pump; + apr_pool_destroy(pool); + + if(mResponse && timeout) + { + mResponse->result(mResult); + mResponse = NULL; + } + + return httpResult; + } + + std::string httpGET(const std::string& uri, + bool timeout = false) + { + std::string httpRequest = "GET " + uri + " HTTP/1.0\r\n\r\n"; + return makeRequest(uri, httpRequest, timeout); + } + + std::string httpPOST(const std::string& uri, + const std::string& body, + bool timeout, + const std::string& evilExtra = "") + { + std::ostringstream httpRequest; + httpRequest << "POST " + uri + " HTTP/1.0\r\n"; + httpRequest << "Content-Length: " << body.size() << "\r\n"; + httpRequest << "\r\n"; + httpRequest << body; + httpRequest << evilExtra; + + return makeRequest(uri, httpRequest.str(), timeout); + } + + std::string httpPOST(const std::string& uri, + const std::string& body, + const std::string& evilExtra = "") + { + bool timeout = false; + return httpPOST(uri, body, timeout, evilExtra); + } + }; + + typedef test_group HTTPServiceTestGroup; + typedef HTTPServiceTestGroup::object HTTPServiceTestObject; + HTTPServiceTestGroup httpServiceTestGroup("http service"); + + template<> template<> + void HTTPServiceTestObject::test<1>() + { + std::string result = httpGET("web/hello"); + + ensure_starts_with("web/hello status", result, + "HTTP/1.0 200 OK\r\n"); + + ensure_contains("web/hello content type", result, + "Content-Type: application/xml\r\n"); + + ensure_contains("web/hello content length", result, + "Content-Length: 36\r\n"); + + ensure_contains("web/hello content", result, + "\r\n" + "hello" + ); + } + + template<> template<> + void HTTPServiceTestObject::test<2>() + { + // test various HTTP errors + + std::string actual; + + actual = httpGET("web/missing"); + ensure_starts_with("web/missing 404", actual, + "HTTP/1.0 404 Not Found\r\n"); + + actual = httpGET("web/echo"); + ensure_starts_with("web/echo 405", actual, + "HTTP/1.0 405 Method Not Allowed\r\n"); + } + + template<> template<> + void HTTPServiceTestObject::test<3>() + { + // test POST & content-length handling + + std::string result; + + result = httpPOST("web/echo", + "42"); + + ensure_starts_with("web/echo status", result, + "HTTP/1.0 200 OK\r\n"); + + ensure_contains("web/echo content type", result, + "Content-Type: application/xml\r\n"); + + ensure_contains("web/echo content length", result, + "Content-Length: 35\r\n"); + + ensure_contains("web/hello content", result, + "\r\n" + "42" + ); + +/* TO DO: this test doesn't pass!! + + result = httpPOST("web/echo", + "evil", + "really! evil!!!"); + + ensure_equals("web/echo evil result", result, + "HTTP/1.0 200 OK\r\n" + "Content-Length: 34\r\n" + "\r\n" + "evil" + ); +*/ + } + + template<> template<> + void HTTPServiceTestObject::test<4>() + { + // test calling things based on pipes + + std::string result; + + result = httpGET("wire/hello"); + + ensure_contains("wire/hello", result, "yo!"); + } + + template<> template<> + void HTTPServiceTestObject::test<5>() + { + // test timeout before async response + std::string result; + + bool timeout = true; + result = httpPOST("delayed/echo", + "agent99", timeout); + + ensure_equals("timeout delayed/echo status", result, std::string("")); + } + + template<> template<> + void HTTPServiceTestObject::test<6>() + { + // test delayed service + std::string result; + + result = httpPOST("delayed/echo", + "agent99"); + + ensure_starts_with("delayed/echo status", result, + "HTTP/1.0 200 OK\r\n"); + + ensure_contains("delayed/echo content", result, + "\r\n" + "agent99" + ); + } + + /* TO DO: + test generation of not found and method not allowed errors + */ +} 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 @@ +/** + * @file llmime_tut.cpp + * @author Phoenix + * @date 2006-12-24 + * @brief BRIEF_DESC of llmime_tut.cpp + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include +#include "linden_common.h" +#include "llmime.h" +#include "llsdserialize.h" + +namespace tut +{ + struct mime_index + { + }; + typedef test_group mime_index_t; + typedef mime_index_t::object mime_index_object_t; + tut::mime_index_t tut_mime_index("mime_index"); + + template<> template<> + void mime_index_object_t::test<1>() + { + LLMimeIndex mime; + ensure("no headers", mime.headers().isUndefined()); + ensure_equals("invalid offset", mime.offset(), -1); + ensure_equals("invalid content length", mime.contentLength(), -1); + ensure("no content type", mime.contentType().empty()); + ensure("not multipart", !mime.isMultipart()); + ensure_equals("no attachments", mime.subPartCount(), 0); + } + + template<> template<> + void mime_index_object_t::test<2>() + { + const S32 CONTENT_LENGTH = 6000; + const S32 CONTENT_OFFSET = 100; + const std::string CONTENT_TYPE = std::string("image/j2c"); + LLSD headers; + headers["Content-Length"] = CONTENT_LENGTH; + headers["Content-Type"] = CONTENT_TYPE; + LLMimeIndex mime(headers, CONTENT_OFFSET); + ensure("headers are map", mime.headers().isMap()); + ensure_equals("offset", mime.offset(), CONTENT_OFFSET); + ensure_equals("content length", mime.contentLength(), CONTENT_LENGTH); + ensure_equals("type is image/j2c", mime.contentType(), CONTENT_TYPE); + ensure("not multipart", !mime.isMultipart()); + ensure_equals("no attachments", mime.subPartCount(), 0); + } + + template<> template<> + void mime_index_object_t::test<3>() + { + const S32 MULTI_CONTENT_LENGTH = 8000; + const S32 MULTI_CONTENT_OFFSET = 100; + const std::string MULTI_CONTENT_TYPE = std::string("multipart/mixed"); + LLSD headers; + headers["Content-Length"] = MULTI_CONTENT_LENGTH; + headers["Content-Type"] = MULTI_CONTENT_TYPE; + LLMimeIndex mime(headers, MULTI_CONTENT_OFFSET); + llinfos << "headers: " << LLSDOStreamer(headers) + << llendl; + + + const S32 META_CONTENT_LENGTH = 700; + const S32 META_CONTENT_OFFSET = 69; + const std::string META_CONTENT_TYPE = std::string( + "text/llsd+xml"); + headers = LLSD::emptyMap(); + headers["Content-Length"] = META_CONTENT_LENGTH; + headers["Content-Type"] = META_CONTENT_TYPE; + LLMimeIndex meta(headers, META_CONTENT_OFFSET); + mime.attachSubPart(meta); + + const S32 IMAGE_CONTENT_LENGTH = 6000; + const S32 IMAGE_CONTENT_OFFSET = 200; + const std::string IMAGE_CONTENT_TYPE = std::string("image/j2c"); + headers = LLSD::emptyMap(); + headers["Content-Length"] = IMAGE_CONTENT_LENGTH; + headers["Content-Type"] = IMAGE_CONTENT_TYPE; + LLMimeIndex image(headers, IMAGE_CONTENT_OFFSET); + mime.attachSubPart(image); + + // make sure we have a valid multi-part + ensure("is multipart", mime.isMultipart()); + ensure_equals("multi offset", mime.offset(), MULTI_CONTENT_OFFSET); + ensure_equals( + "multi content length", + mime.contentLength(), + MULTI_CONTENT_LENGTH); + ensure_equals("two attachments", mime.subPartCount(), 2); + + // make sure ranged gets do the right thing with out of bounds + // sub-parts. + LLMimeIndex invalid_child(mime.subPart(-1)); + ensure("no headers", invalid_child.headers().isUndefined()); + ensure_equals("invalid offset", invalid_child.offset(), -1); + ensure_equals( + "invalid content length", invalid_child.contentLength(), -1); + ensure("no content type", invalid_child.contentType().empty()); + ensure("not multipart", !invalid_child.isMultipart()); + ensure_equals("no attachments", invalid_child.subPartCount(), 0); + + invalid_child = mime.subPart(2); + ensure("no headers", invalid_child.headers().isUndefined()); + ensure_equals("invalid offset", invalid_child.offset(), -1); + ensure_equals( + "invalid content length", invalid_child.contentLength(), -1); + ensure("no content type", invalid_child.contentType().empty()); + ensure("not multipart", !invalid_child.isMultipart()); + ensure_equals("no attachments", invalid_child.subPartCount(), 0); + } + + template<> template<> + void mime_index_object_t::test<4>() + { + const S32 MULTI_CONTENT_LENGTH = 8000; + const S32 MULTI_CONTENT_OFFSET = 100; + const std::string MULTI_CONTENT_TYPE = std::string("multipart/mixed"); + LLSD headers; + headers["Content-Length"] = MULTI_CONTENT_LENGTH; + headers["Content-Type"] = MULTI_CONTENT_TYPE; + LLMimeIndex mime(headers, MULTI_CONTENT_OFFSET); + + const S32 META_CONTENT_LENGTH = 700; + const S32 META_CONTENT_OFFSET = 69; + const std::string META_CONTENT_TYPE = std::string( + "application/llsd+xml"); + headers = LLSD::emptyMap(); + headers["Content-Length"] = META_CONTENT_LENGTH; + headers["Content-Type"] = META_CONTENT_TYPE; + LLMimeIndex meta(headers, META_CONTENT_OFFSET); + mime.attachSubPart(meta); + + const S32 IMAGE_CONTENT_LENGTH = 6000; + const S32 IMAGE_CONTENT_OFFSET = 200; + const std::string IMAGE_CONTENT_TYPE = std::string("image/j2c"); + headers = LLSD::emptyMap(); + headers["Content-Length"] = IMAGE_CONTENT_LENGTH; + headers["Content-Type"] = IMAGE_CONTENT_TYPE; + LLMimeIndex image(headers, IMAGE_CONTENT_OFFSET); + mime.attachSubPart(image); + + // check what we have + ensure("is multipart", mime.isMultipart()); + ensure_equals("multi offset", mime.offset(), MULTI_CONTENT_OFFSET); + ensure_equals( + "multi content length", + mime.contentLength(), + MULTI_CONTENT_LENGTH); + ensure_equals("two attachments", mime.subPartCount(), 2); + + LLMimeIndex actual_meta = mime.subPart(0); + ensure_equals( + "meta type", actual_meta.contentType(), META_CONTENT_TYPE); + ensure_equals( + "meta offset", actual_meta.offset(), META_CONTENT_OFFSET); + ensure_equals( + "meta content length", + actual_meta.contentLength(), + META_CONTENT_LENGTH); + + LLMimeIndex actual_image = mime.subPart(1); + ensure_equals( + "image type", actual_image.contentType(), IMAGE_CONTENT_TYPE); + ensure_equals( + "image offset", actual_image.offset(), IMAGE_CONTENT_OFFSET); + ensure_equals( + "image content length", + actual_image.contentLength(), + IMAGE_CONTENT_LENGTH); + } + +/* + template<> template<> + void mime_index_object_t::test<5>() + { + } + template<> template<> + void mime_index_object_t::test<6>() + { + } + template<> template<> + void mime_index_object_t::test<7>() + { + } + template<> template<> + void mime_index_object_t::test<8>() + { + } + template<> template<> + void mime_index_object_t::test<>() + { + } +*/ +} + + +namespace tut +{ + struct mime_parse + { + }; + typedef test_group mime_parse_t; + typedef mime_parse_t::object mime_parse_object_t; + tut::mime_parse_t tut_mime_parse("mime_parse"); + + template<> template<> + void mime_parse_object_t::test<1>() + { + // parse one mime object + const std::string SERIALIZED_MIME("Content-Length: 200\r\nContent-Type: text/plain\r\n\r\naaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccc\r\n"); + std::stringstream istr; + istr.str(SERIALIZED_MIME); + LLMimeIndex mime; + LLMimeParser parser; + bool ok = parser.parseIndex(istr, mime); + ensure("Parse successful.", ok); + ensure_equals("content type", mime.contentType(), "text/plain"); + ensure_equals("content length", mime.contentLength(), 200); + ensure_equals("offset", mime.offset(), 49); + } + + template<> template<> + void mime_parse_object_t::test<2>() + { + // make sure we only parse one. + 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"); + std::stringstream istr; + istr.str(SERIALIZED_MIME); + LLMimeIndex mime; + LLMimeParser parser; + bool ok = parser.parseIndex(istr, mime); + ensure("Parse successful.", ok); + ensure("not multipart.", !mime.isMultipart()); + ensure_equals("content type", mime.contentType(), "text/plain"); + ensure_equals("content length", mime.contentLength(), 200); + ensure_equals("offset", mime.offset(), 49); + } + + template<> template<> + void mime_parse_object_t::test<3>() + { + // test multi-part and lack of content length for some of it. + /* +Content-Type: multipart/mixed; boundary="segment"rnContent-Length: 148rnrn--segmentrnContent-Type: text/plainrnrnsome datarnrn--segmentrnContent-Type: text/xml; charset=UTF-8rnContent-Length: 22rnrnrnrn + */ + 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\r\n\r\n"); + std::stringstream istr; + istr.str(SERIALIZED_MIME); + LLMimeIndex mime; + LLMimeParser parser; + bool ok = parser.parseIndex(istr, mime); + ensure("Parse successful.", ok); + ensure("is multipart.", mime.isMultipart()); + ensure_equals("sub-part count", mime.subPartCount(), 2); + ensure_equals("content length", mime.contentLength(), 150); + ensure_equals("data offset for multipart", mime.offset(), 74); + + LLMimeIndex mime_plain(mime.subPart(0)); + ensure_equals( + "first part type", + mime_plain.contentType(), + "text/plain"); + ensure_equals( + "first part content length not known.", + mime_plain.contentLength(), + -1); + ensure_equals("first part offset", mime_plain.offset(), 113); + + LLMimeIndex mime_xml(mime.subPart(1)); + ensure_equals( + "second part type", + mime_xml.contentType(), + "text/xml; charset=UTF-8"); + ensure_equals( + "second part content length", + mime_xml.contentLength(), + 22); + ensure_equals("second part offset", mime_xml.offset(), 198); + } + + template<> template<> + void mime_parse_object_t::test<4>() + { + // test multi-part, unquoted separator, and premature eof conditions + /* +Content-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: 22rnrnrnrn */ + 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\r\n\r\n"); + std::stringstream istr; + istr.str(SERIALIZED_MIME); + LLMimeIndex mime; + LLMimeParser parser; + bool ok = parser.parseIndex(istr, mime); + ensure("Parse successful.", ok); + ensure("is multipart.", mime.isMultipart()); + ensure_equals("sub-part count", mime.subPartCount(), 2); + ensure_equals("content length", mime.contentLength(), 220); + ensure_equals("data offset for multipart", mime.offset(), 72); + + LLMimeIndex mime_plain(mime.subPart(0)); + ensure_equals( + "first part type", + mime_plain.contentType(), + "text/plain"); + ensure_equals( + "first part content length", + mime_plain.contentLength(), + 55); + ensure_equals("first part offset", mime_plain.offset(), 131); + + LLMimeIndex mime_xml(mime.subPart(1)); + ensure_equals( + "second part type", + mime_xml.contentType(), + "text/xml; charset=UTF-8"); + ensure_equals( + "second part content length", + mime_xml.contentLength(), + 22); + ensure_equals("second part offset", mime_xml.offset(), 262); + } + + template<> template<> + void mime_parse_object_t::test<5>() + { + // test multi-part with multiple params + 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\r\n\r\n"); + std::stringstream istr; + istr.str(SERIALIZED_MIME); + LLMimeIndex mime; + LLMimeParser parser; + bool ok = parser.parseIndex(istr, mime); + ensure("Parse successful.", ok); + ensure("is multipart.", mime.isMultipart()); + ensure_equals("sub-part count", mime.subPartCount(), 2); + ensure_equals("content length", mime.contentLength(), 220); + + LLMimeIndex mime_plain(mime.subPart(0)); + ensure_equals( + "first part type", + mime_plain.contentType(), + "text/plain"); + ensure_equals( + "first part content length", + mime_plain.contentLength(), + 55); + + LLMimeIndex mime_xml(mime.subPart(1)); + ensure_equals( + "second part type", + mime_xml.contentType(), + "text/xml; charset=UTF-8"); + ensure_equals( + "second part content length", + mime_xml.contentLength(), + 22); + } + + template<> template<> + void mime_parse_object_t::test<6>() + { + // test multi-part with no specified boundary and eof +/* +Content-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: 22rnrnrnrn +*/ + 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\r\n\r\n"); + std::stringstream istr; + istr.str(SERIALIZED_MIME); + LLMimeIndex mime; + LLMimeParser parser; + bool ok = parser.parseIndex(istr, mime); + ensure("Parse successful.", ok); + ensure("is multipart.", mime.isMultipart()); + ensure_equals("sub-part count", mime.subPartCount(), 2); + ensure_equals("content length", mime.contentLength(), 500); + ensure_equals("data offset for multipart", mime.offset(), 56); + + LLMimeIndex mime_plain(mime.subPart(0)); + ensure_equals( + "first part type", + mime_plain.contentType(), + "text/plain"); + ensure_equals( + "first part content length", + mime_plain.contentLength(), + 55); + ensure_equals("first part offset", mime_plain.offset(), 108); + + LLMimeIndex mime_xml(mime.subPart(1)); + ensure_equals( + "second part type", + mime_xml.contentType(), + "text/xml; charset=UTF-8"); + ensure_equals( + "second part content length", + mime_xml.contentLength(), + 22); + ensure_equals("second part offset", mime_xml.offset(), 232); + } + +/* + template<> template<> + void mime_parse_object_t::test<>() + { + } + template<> template<> + void mime_parse_object_t::test<>() + { + } + template<> template<> + void mime_parse_object_t::test<>() + { + } + template<> template<> + void mime_parse_object_t::test<>() + { + } +*/ +} 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 @@ +/** + * @file llpipeutil.cpp + * @date 2006-05-18 + * @brief Utility pipe fittings for injecting and extracting strings + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include "llpipeutil.h" + +#include + +#include "llbufferstream.h" +#include "llframetimer.h" +#include "llpumpio.h" +#include "llrand.h" +#include "lltimer.h" + +F32 pump_loop(LLPumpIO* pump, F32 seconds) +{ + LLTimer timer; + timer.setTimerExpirySec(seconds); + while(!timer.hasExpired()) + { + LLFrameTimer::updateFrameTime(); + pump->pump(); + pump->callback(); + } + return timer.getElapsedTimeF32(); +} + +//virtual +LLIOPipe::EStatus LLPipeStringInjector::process_impl( + const LLChannelDescriptors& channels, + buffer_ptr_t& buffer, + bool& eos, + LLSD& context, + LLPumpIO* pump) +{ + buffer->append(channels.out(), (U8*) mString.data(), mString.size()); + eos = true; + return STATUS_DONE; +} + + +LLIOPipe::EStatus LLPipeStringExtractor::process_impl( + const LLChannelDescriptors& channels, + buffer_ptr_t& buffer, + bool& eos, + LLSD& context, + LLPumpIO* pump) +{ + if(!eos) return STATUS_BREAK; + if(!pump || !buffer) return STATUS_PRECONDITION_NOT_MET; + + LLBufferStream istr(channels, buffer.get()); + std::ostringstream ostr; + while (istr.good()) + { + char buf[1024]; + istr.read(buf, sizeof(buf)); + ostr.write(buf, istr.gcount()); + } + mString = ostr.str(); + mDone = true; + + return STATUS_DONE; +} + + +// virtual +LLIOPipe::EStatus LLIOFuzz::process_impl( + const LLChannelDescriptors& channels, + buffer_ptr_t& buffer, + bool& eos, + LLSD& context, + LLPumpIO* pump) +{ + while(mByteCount) + { + std::vector data; + data.reserve(10000); + int size = llmin(10000, mByteCount); + std::generate_n( + std::back_insert_iterator< std::vector >(data), + size, + rand); + buffer->append(channels.out(), &data[0], size); + mByteCount -= size; + } + return STATUS_OK; +} + +struct random_ascii_generator +{ + random_ascii_generator() {} + U8 operator()() + { + int rv = rand(); + rv %= (127 - 32); + rv += 32; + return rv; + } +}; + +// virtual +LLIOPipe::EStatus LLIOASCIIFuzz::process_impl( + const LLChannelDescriptors& channels, + buffer_ptr_t& buffer, + bool& eos, + LLSD& context, + LLPumpIO* pump) +{ + while(mByteCount) + { + std::vector data; + data.reserve(10000); + int size = llmin(10000, mByteCount); + std::generate_n( + std::back_insert_iterator< std::vector >(data), + size, + random_ascii_generator()); + buffer->append(channels.out(), &data[0], size); + mByteCount -= size; + } + return STATUS_OK; +} + +// virtual +LLIOPipe::EStatus LLIONull::process_impl( + const LLChannelDescriptors& channels, + buffer_ptr_t& buffer, + bool& eos, + LLSD& context, + LLPumpIO* pump) +{ + return STATUS_OK; +} 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 @@ +/** + * @file llpipeutil.h + * @date 2006-05-18 + * @brief Utility pipe fittings for injecting and extracting strings + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#ifndef LL_LLPIPEUTIL_H +#define LL_LLPIPEUTIL_H + +#include "lliopipe.h" + + +/** + * @brief Simple function which pumps for the specified time. + */ +F32 pump_loop(LLPumpIO* pump, F32 seconds); + +/** + * @brief Simple class which writes a string and then marks the stream + * as done. + */ +class LLPipeStringInjector : public LLIOPipe +{ +public: + LLPipeStringInjector(const std::string& string) + : mString(string) + { } + +protected: + virtual EStatus process_impl( + const LLChannelDescriptors& channels, + buffer_ptr_t& buffer, + bool& eos, + LLSD& context, + LLPumpIO* pump); + +private: + std::string mString; +}; + + +class LLPipeStringExtractor : public LLIOPipe +{ +public: + LLPipeStringExtractor() : mDone(false) { } + + bool done() { return mDone; } + std::string string() { return mString; } + +protected: + // LLIOPipe API implementation. + virtual EStatus process_impl( + const LLChannelDescriptors& channels, + LLIOPipe::buffer_ptr_t& buffer, + bool& eos, + LLSD& context, + LLPumpIO* pump); + +private: + bool mDone; + std::string mString; +}; + +/** + * @brief Generate a specified number of bytes of random data + */ +class LLIOFuzz : public LLIOPipe +{ +public: + LLIOFuzz(int byte_count) : mByteCount(byte_count) {} + +protected: + virtual EStatus process_impl( + const LLChannelDescriptors& channels, + buffer_ptr_t& buffer, + bool& eos, + LLSD& context, + LLPumpIO* pump); + +private: + int mByteCount; +}; + +/** + * @brief Generate some ascii fuz + */ +class LLIOASCIIFuzz : public LLIOPipe +{ +public: + LLIOASCIIFuzz(int byte_count) : mByteCount(byte_count) {} + +protected: + virtual EStatus process_impl( + const LLChannelDescriptors& channels, + buffer_ptr_t& buffer, + bool& eos, + LLSD& context, + LLPumpIO* pump); + +private: + int mByteCount; +}; + + +/** + * @brief Pipe that does nothing except return STATUS_OK + */ +class LLIONull : public LLIOPipe +{ +public: + LLIONull() {} + +protected: + virtual EStatus process_impl( + const LLChannelDescriptors& channels, + buffer_ptr_t& buffer, + bool& eos, + LLSD& context, + LLPumpIO* pump); +}; + +#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 @@ +/** + * @file llsd_message_system_tut.cpp + * @brief Testing the LLSDMessageSystem. + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +/** + * + * These classes test the LLSDMessageSystem. + * + */ + +#include +#include "llsdmessagesystem.h" +#include "llsdutil.h" + +namespace tut +{ + class LLSDMessageSystemTestData + { + public: + LLSDMessageSystemTestData() {;} + ~LLSDMessageSystemTestData() {;} + + LLSDMessageSystem mMsgSystem; + }; + + typedef test_group LLSDMessageSystemTestGroup; + typedef LLSDMessageSystemTestGroup::object LLSDMessageSystemTestObject; + LLSDMessageSystemTestGroup llsdMessageSystemTestGroup("llsd_message_system"); + + template<> template<> + void LLSDMessageSystemTestObject::test<1>() + { + LLSD input; + U32 valueIn, valueOut; + valueIn = 42; + input["Block"]["Var"] = ll_sd_from_U32(valueIn); + mMsgSystem.setInput(input); + mMsgSystem.getU32Fast("Block", "Var", valueOut); + ensure_equals("U32 from message system matches input U32", valueIn, valueOut); + } + + template<> template<> + void LLSDMessageSystemTestObject::test<2>() + { + LLSD input; + LLUUID valueIn, valueOut; + valueIn.generate(); + input["Block"]["Var"] = valueIn; + mMsgSystem.setInput(input); + mMsgSystem.getUUIDFast("Block", "Var", valueOut); + ensure_equals("UUID from message system matches input UUID", valueIn, valueOut); + } + + template<> template<> + void LLSDMessageSystemTestObject::test<3>() + { + LLSD input; + U32 valueIn, valueOut; + LLHost host("127.0.0.1:80"); + valueIn = host.getAddress(); + input["Block"]["Var"] = ll_sd_from_U32(valueIn); + mMsgSystem.setInput(input); + mMsgSystem.getIPAddrFast("Block", "Var", valueOut); + ensure_equals("IP from message system matches input IP", valueIn, valueOut); + } + + template<> template<> + void LLSDMessageSystemTestObject::test<4>() + { + LLSD input; + U16 valueIn, valueOut; + LLHost host("127.0.0.1:80"); + valueIn = host.getPort(); + input["Block"]["Var"] = (S32)valueIn; + mMsgSystem.setInput(input); + mMsgSystem.getIPPortFast("Block", "Var", valueOut); + ensure_equals("Port from message system matches input port", valueIn, valueOut); + } + + template<> template<> + void LLSDMessageSystemTestObject::test<5>() + { + LLSD input; + U64 valueIn, valueOut; + valueIn = 42; + input["Block"]["Var"] = ll_sd_from_U64(valueIn); + mMsgSystem.setInput(input); + mMsgSystem.getU64Fast("Block", "Var", valueOut); + ensure_equals("Port from message system matches input port", valueIn, valueOut); + } + + template<> template<> + void LLSDMessageSystemTestObject::test<6>() + { + LLSD input; + std::string valueIn = "Value"; + input["Block"]["Var"] = valueIn; + mMsgSystem.setInput(input); + const U32 buffLen = 16; + char buff[buffLen]; + mMsgSystem.getStringFast("Block", "Var", buffLen, buff); + ensure_equals("string read from message system matches llsd input", std::string(buff), valueIn); + } + + template<> template<> + void LLSDMessageSystemTestObject::test<7>() + { + LLSD input; + U32 valueIn, valueOut; + valueIn = 42; + input["Block"][0]["Var"] = ll_sd_from_U32(valueIn); + input["Block"][1]["Var"] = ll_sd_from_U32(valueIn + 1); + mMsgSystem.setInput(input); + mMsgSystem.getU32Fast("Block", "Var", valueOut, 0); + ensure_equals("U32 from message system matches input U32", valueIn, valueOut); + mMsgSystem.getU32Fast("Block", "Var", valueOut, 1); + ensure_equals("U32 from message system matches input U32", (valueIn + 1), valueOut); + } +} 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 @@ +/** + * @file llsd_new_tut.cpp + * @date February 2006 + * @brief LLSD unit tests + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include +#include +#include "lltut.h" + +#include "llsd.h" + +namespace tut +{ + template + class SDTraits + { + protected: + typedef T (LLSD::*Getter)() const; + + LLSD::Type type; + Getter getter; + + public: + SDTraits(); + + T get(const LLSD& actual) + { + return (actual.*getter)(); + } + + bool checkType(const LLSD& actual) + { + return actual.type() == type; + } + }; + + template<> + SDTraits::SDTraits() + : type(LLSD::TypeBoolean), getter(&LLSD::asBoolean) + { } + + template<> + SDTraits::SDTraits() + : type(LLSD::TypeInteger), getter(&LLSD::asInteger) + { } + + template<> + SDTraits::SDTraits() + : type(LLSD::TypeReal), getter(&LLSD::asReal) + { } + + template<> + SDTraits::SDTraits() + : type(LLSD::TypeUUID), getter(&LLSD::asUUID) + { } + + template<> + SDTraits::SDTraits() + : type(LLSD::TypeString), getter(&LLSD::asString) + { } + + template<> + class SDTraits : public SDTraits + { }; + + template<> + class SDTraits : public SDTraits + { }; + + template<> + SDTraits::SDTraits() + : type(LLSD::TypeDate), getter(&LLSD::asDate) + { } + + template<> + SDTraits::SDTraits() + : type(LLSD::TypeURI), getter(&LLSD::asURI) + { } + + template<> + SDTraits::SDTraits() + : type(LLSD::TypeBinary), getter(&LLSD::asBinary) + { } + + class SDCleanupCheck + { + private: + U32 mOutstandingAtStart; + public: + SDCleanupCheck() : mOutstandingAtStart(LLSD::outstandingCount()) { } + ~SDCleanupCheck() + { + ensure_equals("SDCleanupCheck", + LLSD::outstandingCount(), mOutstandingAtStart); + } + }; + + class SDAllocationCheck : public SDCleanupCheck + { + private: + std::string mMessage; + U32 mExpectedAllocations; + U32 mAllocationAtStart; + public: + SDAllocationCheck(const std::string& message, int expectedAllocations) + : mMessage(message), + mExpectedAllocations(expectedAllocations), + mAllocationAtStart(LLSD::allocationCount()) + { } + ~SDAllocationCheck() + { + ensure_equals(mMessage + " SDAllocationCheck", + LLSD::allocationCount() - mAllocationAtStart, + mExpectedAllocations); + } + }; + + struct SDTestData { + template + static void ensureTypeAndValue(const char* msg, const LLSD& actual, + T expectedValue) + { + SDTraits traits; + + std::string s(msg); + + ensure( s + " type", traits.checkType(actual)); + ensure_equals( s + " value", traits.get(actual), expectedValue); + } + }; + + typedef test_group SDTestGroup; + typedef SDTestGroup::object SDTestObject; + + SDTestGroup sdTestGroup("LLSD(new)"); + + template<> template<> + void SDTestObject::test<1>() + // construction and test of undefined + { + SDCleanupCheck check; + + LLSD u; + ensure("is undefined", u.isUndefined()); + } + + template<> template<> + void SDTestObject::test<2>() + // setting and fetching scalar types + { + SDCleanupCheck check; + + LLSD v; + + v = true; ensureTypeAndValue("set true", v, true); + v = false; ensureTypeAndValue("set false", v, false); + v = true; ensureTypeAndValue("set true again", v, true); + + v = 42; ensureTypeAndValue("set to 42", v, 42); + v = 0; ensureTypeAndValue("set to zero", v, 0); + v = -12345; ensureTypeAndValue("set to neg", v, -12345); + v = 2000000000; ensureTypeAndValue("set to big", v, 2000000000); + + v = 3.14159265359; + ensureTypeAndValue("set to pi", v, 3.14159265359); + ensure_not_equals("isn't float", v.asReal(), + (float)3.14159265359); + v = 6.7e256; ensureTypeAndValue("set to big", v, 6.7e256); + + LLUUID nullUUID; + LLUUID newUUID; + newUUID.generate(); + + v = nullUUID; ensureTypeAndValue("set to null UUID", v, nullUUID); + v = newUUID; ensureTypeAndValue("set to new UUID", v, newUUID); + v = nullUUID; ensureTypeAndValue("set to null again", v, nullUUID); + + // strings must be tested with three (!) types of string objects + std::string s = "now is the time"; + LLString ls = "for all good zorks"; + const char* cs = "to come to the air of their planet"; + + v = s; ensureTypeAndValue("set to std::string", v, s); + v = ls; ensureTypeAndValue("set to LLString", v, ls); + v = cs; ensureTypeAndValue("set to const char*", v, cs); + + LLDate epoch; + LLDate aDay("2001-10-22T10:11:12.00Z"); + + v = epoch; ensureTypeAndValue("set to epoch", v, epoch); + v = aDay; ensureTypeAndValue("set to a day", v, aDay); + + LLURI path("http://slurl.com/secondlife/Ambleside/57/104/26/"); + + v = path; ensureTypeAndValue("set to a uri", v, path); + + const char source[] = "once in a blue moon"; + std::vector data; + copy(&source[0], &source[sizeof(source)], back_inserter(data)); + + v = data; ensureTypeAndValue("set to data", v, data); + + v.clear(); + ensure("reset to undefined", v.type() == LLSD::TypeUndefined); + } + + template<> template<> + void SDTestObject::test<3>() + // construction via scalar values + // tests both constructor and initialize forms + { + SDCleanupCheck check; + + LLSD b1(true); ensureTypeAndValue("construct boolean", b1, true); + LLSD b2 = true; ensureTypeAndValue("initialize boolean", b2, true); + LLSD i1(42); ensureTypeAndValue("construct int", i1, 42); + LLSD i2 =42; ensureTypeAndValue("initialize int", i2, 42); + LLSD d1(1.2); ensureTypeAndValue("construct double", d1, 1.2); + LLSD d2 = 1.2; ensureTypeAndValue("initialize double", d2, 1.2); + + LLUUID newUUID; + newUUID.generate(); + LLSD u1(newUUID); + ensureTypeAndValue("construct UUID", u1, newUUID); + LLSD u2 = newUUID; + ensureTypeAndValue("initialize UUID", u2, newUUID); + + LLSD ss1(std::string("abc")); + ensureTypeAndValue("construct std::string", ss1, "abc"); + LLSD ss2 = std::string("abc"); + ensureTypeAndValue("initialize std::string",ss2, "abc"); + LLSD sl1(LLString("def")); + ensureTypeAndValue("construct LLString", sl1, "def"); + LLSD sl2 = LLString("def"); + ensureTypeAndValue("initialize LLString", sl2, "def"); + LLSD sc1("ghi"); + ensureTypeAndValue("construct const char*", sc1, "ghi"); + LLSD sc2 = "ghi"; + ensureTypeAndValue("initialize const char*",sc2, "ghi"); + + LLDate aDay("2001-10-22T10:11:12.00Z"); + LLSD t1(aDay); ensureTypeAndValue("construct LLDate", t1, aDay); + LLSD t2 = aDay; ensureTypeAndValue("initialize LLDate", t2, aDay); + + LLURI path("http://slurl.com/secondlife/Ambleside/57/104/26/"); + LLSD p1(path); ensureTypeAndValue("construct LLURI", p1, path); + LLSD p2 = path; ensureTypeAndValue("initialize LLURI", p2, path); + + const char source[] = "once in a blue moon"; + std::vector data; + copy(&source[0], &source[sizeof(source)], back_inserter(data)); + LLSD x1(data); ensureTypeAndValue("construct vector", x1, data); + LLSD x2 = data; ensureTypeAndValue("initialize vector", x2, data); + } + + void checkConversions(const char* msg, const LLSD& v, + LLSD::Boolean eBoolean, LLSD::Integer eInteger, + LLSD::Real eReal, const LLSD::String& eString) + { + std::string s(msg); + + ensure_equals(s+" to bool", v.asBoolean(), eBoolean); + ensure_equals(s+" to int", v.asInteger(), eInteger); + if (eReal == eReal) + { + ensure_equals(s+" to real", v.asReal(), eReal); + ensure_equals(s+" to string", v.asString(), eString); + } + else + { +// TODO: Fix on windows.... +#ifndef LL_WINDOWS +# if !defined(fpclassify) && __GNUC__ >= 3 +# define FPCLASSIFY_NAMESPACE std:: +# else +# define FPCLASSIFY_NAMESPACE +# endif + int left = FPCLASSIFY_NAMESPACE fpclassify(v.asReal()); + int right = FPCLASSIFY_NAMESPACE fpclassify(eReal); + + ensure_equals(s+" to real", left, right); + ensure_equals(s+" to string", v.asString(), eString); +#endif + } + } + + template<> template<> + void SDTestObject::test<4>() + // conversion between undefined and basic scalar types: + // boolean, integer, real and string + { + SDCleanupCheck check; + + LLSD v; checkConversions("untitled", v, false, 0, 0.0, ""); + + v = false; checkConversions("false", v, false, 0, 0.0, ""); + v = true; checkConversions("true", v, true, 1, 1.0, "true"); + + v = 0; checkConversions("zero", v, false, 0, 0.0, "0"); + v = 1; checkConversions("one", v, true, 1, 1.0, "1"); + v = -33; checkConversions("neg33", v, true, -33, -33.0, "-33"); + + v = 0.0; checkConversions("0.0", v, false, 0, 0.0, "0"); + v = 0.5; checkConversions("point5", v, true, 0, 0.5, "0.5"); + v = 0.9; checkConversions("point9", v, true, 0, 0.9, "0.9"); + v = -3.9; checkConversions("neg3dot9", v, true, -3, -3.9, "-3.9"); + v = sqrt(-1.0); checkConversions("NaN", v, false, 0, sqrt(-1.0), "nan"); + + v = ""; checkConversions("empty", v, false, 0, 0.0, ""); + v = "0"; checkConversions("digit0", v, true, 0, 0.0, "0"); + v = "10"; checkConversions("digit10", v, true, 10, 10.0, "10"); + v = "-2.345"; checkConversions("decdigits", v, + true, -2, -2.345, "-2.345"); + v = "apple"; checkConversions("apple", v, true, 0, 0.0, "apple"); + v = "33bob"; checkConversions("digialpha", v, true, 0, 0.0, "33bob"); + v = " "; checkConversions("space", v, true, 0, 0.0, " "); + v = "\n"; checkConversions("newline", v, true, 0, 0.0, "\n"); + } + + template + void checkRoundTrip(const std::string& msg, const LLSD& actual, + const char* sExpected, T vExpected) + { + std::string str = actual.asString(); + + if (sExpected) { + ensure_equals(msg + " string", str, sExpected); + } + + LLSD u(str); + SDTraits traits; + + ensure_equals(msg + " value", traits.get(u), vExpected); + } + + + template<> template<> + void SDTestObject::test<5>() + // conversion of String to and from UUID, Date and URI. + { + SDCleanupCheck check; + + LLSD v; + + LLUUID nullUUID; + LLUUID someUUID; + someUUID.generate(); + + v = nullUUID; checkRoundTrip("null uuid", v, + "00000000-0000-0000-0000-000000000000", nullUUID); + v = someUUID; checkRoundTrip("random uuid", v, 0, someUUID); + + LLDate epoch; + LLDate beta("2003-04-30T04:00:00Z"); + LLDate oneOh("2003-06-23T04:00:00Z"); + + v = epoch; checkRoundTrip("epoch date", v, 0, epoch); + v = beta; checkRoundTrip("beta date", v, + "2003-04-30T04:00:00Z", beta); + v = oneOh; checkRoundTrip("1.0 date", v, + "2003-06-23T04:00:00Z", oneOh); + + LLURI empty; + LLURI path("http://slurl.com/secondlife/Ambleside/57/104/26/"); + LLURI mail("mailto:zero.linden@secondlife.com"); + + v = empty; checkRoundTrip("empty URI", v, 0, empty); + v = path; checkRoundTrip("path URI", v, + "http://slurl.com/secondlife/Ambleside/57/104/26/", + path); + v = mail; checkRoundTrip("mail URI", v, + "mailto:zero.linden@secondlife.com", mail); + } + + template<> template<> + void SDTestObject::test<6>() + // copy construction and assignment + // checking for shared values after constr. or assignment + // checking in both the same type and change of type case + { + SDCleanupCheck check; + + { + LLSD v = 42; + + LLSD w0(v); + ensureTypeAndValue("int constr.", w0, 42); + + LLSD w1(v); + w1 = 13; + ensureTypeAndValue("int constr. change case 1", w1, 13); + ensureTypeAndValue("int constr. change case 2", v, 42); + + LLSD w2(v); + v = 7; + ensureTypeAndValue("int constr. change case 3", w2, 42); + ensureTypeAndValue("int constr. change case 4", v, 7); + } + + { + LLSD v = 42; + + LLSD w1(v); + w1 = "bob"; + ensureTypeAndValue("string constr. change case 1", w1, "bob"); + ensureTypeAndValue("string constr. change case 2", v, 42); + + LLSD w2(v); + v = "amy"; + ensureTypeAndValue("string constr. change case 3", w2, 42); + ensureTypeAndValue("string constr. change case 4", v, "amy"); + } + + { + LLSD v = 42; + + LLSD w0; + w0 = v; + ensureTypeAndValue("int assign", w0, 42); + + LLSD w1; + w1 = v; + w1 = 13; + ensureTypeAndValue("int assign change case 1", w1, 13); + ensureTypeAndValue("int assign change case 2", v, 42); + + LLSD w2; + w2 = v; + v = 7; + ensureTypeAndValue("int assign change case 3", w2, 42); + ensureTypeAndValue("int assign change case 4", v, 7); + } + + { + LLSD v = 42; + + LLSD w1; + w1 = v; + w1 = "bob"; + ensureTypeAndValue("string assign change case 1", w1, "bob"); + ensureTypeAndValue("string assign change case 2", v, 42); + + LLSD w2; + w2 = v; + v = "amy"; + ensureTypeAndValue("string assign change case 3", w2, 42); + ensureTypeAndValue("string assign change case 4", v, "amy"); + } + } + + + template<> template<> + void SDTestObject::test<7>() + // Test assignment and casting to various scalar types. These + // assignments should invoke the right conversion without it being + // mentioned explicitly. The few exceptions are marked SAD. + { + SDCleanupCheck check; + + LLSD v(" 42.375"); + + bool b = false; + b = v; ensure_equals("assign to bool", b, true); + b = (bool)v; ensure_equals("cast to bool", b, true); + + int i = 99; + i = v; ensure_equals("assign to int", i, 42); + i = (int)v; ensure_equals("cast to int", i, 42); + + double d = 3.14159; + d = v; ensure_equals("assign to double", d, 42.375); + d = (double)v; ensure_equals("cast to double", d, 42.375); + + std::string s = "yo"; +// SAD s = v; ensure_equals("assign to string", s, " 42.375"); + s = (std::string)v; ensure_equals("cast to string", s, " 42.375"); + + LLString t = "yo"; +// SAD t = v; ensure_equals("assign to LLString", t, " 42.375"); + t = (LLString)v; ensure_equals("cast to LLString", t, " 42.375"); + + std::string uuidStr = "b1e50c2b-b627-4d23-8a86-a65d97b6319b"; + v = uuidStr; + LLUUID u; + u = v; + ensure_equals("assign to LLUUID", u, LLUUID(uuidStr)); +// SAD u = (LLUUID)v; +// ensure_equals("cast to LLUUID", u, LLUUID(uuidStr)); + + std::string dateStr = "2005-10-24T15:00:00Z"; + v = dateStr; + LLDate date; + date = v; + ensure_equals("assign to LLDate", date.asString(), dateStr); +// SAD date = (LLDate)v; +// ensure_equals("cast to LLDate", date.asString(), dateStr); + + std::string uriStr = "http://secondlife.com"; + v = uriStr; + LLURI uri; + uri = v; + ensure_equals("assign to LLURI", uri.asString(), uriStr); +// SAD uri = (LLURI)v; +// ensure_equals("cast to LLURI", uri.asString(), uriStr); + } + + template<> template<> + void SDTestObject::test<8>() + // Test construction of various scalar types from LLSD. + // Test both construction and initialization forms. + // These should invoke the right conversion without it being + // mentioned explicitly. The few exceptions are marked SAD. + { + SDCleanupCheck check; + + LLSD v(" 42.375"); + + bool b1(v); ensure_equals("contruct bool", b1, true); + bool b2 = v; ensure_equals("initialize bool", b2, true); + + int i1(v); ensure_equals("contruct int", i1, 42); + int i2 = v; ensure_equals("initialize int", i2, 42); + + double d1(v); ensure_equals("contruct double", d1, 42.375); + double d2 = v; ensure_equals("initialize double", d2, 42.375); + + std::string s1(v); + std::string s2 = v; + ensure_equals("contruct string", s1, " 42.375"); + ensure_equals("initialize string", s2, " 42.375"); + + LLString t1(v); + LLString t2 = v.asString(); // SAD + ensure_equals("contruct LLString", t1, " 42.375"); + ensure_equals("initialize LLString", t2, " 42.375"); + + std::string uuidStr = "b1e50c2b-b627-4d23-8a86-a65d97b6319b"; + v = uuidStr; + LLUUID uuid1(v.asUUID()); // SAD + LLUUID uuid2 = v; + ensure_equals("contruct LLUUID", uuid1, LLUUID(uuidStr)); + ensure_equals("initialize LLUUID", uuid2, LLUUID(uuidStr)); + + std::string dateStr = "2005-10-24T15:00:00Z"; + v = dateStr; + LLDate date1(v.asDate()); // SAD + LLDate date2 = v; + ensure_equals("contruct LLDate", date1.asString(), dateStr); + ensure_equals("initialize LLDate", date2.asString(), dateStr); + + std::string uriStr = "http://secondlife.com"; + v = uriStr; + LLURI uri1(v.asURI()); // SAD + LLURI uri2 = v; + ensure_equals("contruct LLURI", uri1.asString(), uriStr); + ensure_equals("initialize LLURI", uri2.asString(), uriStr); + } + + + template<> template<> + void SDTestObject::test<9>() + // test to make sure v is interpreted as a bool in a various + // scenarios. + { + SDCleanupCheck check; + + LLSD v = "0"; + // magic value that is interpreted as boolean true, but integer false! + + ensure_equals("trinary operator bool", (v ? true : false), true); + ensure_equals("convert to int, then bool", + ((int)v ? true : false), false); + + if(v) + { + ensure("if converted to bool", true); + } + else + { + fail("bool did not convert to a bool in if statement."); + } + + if(!v) + { + fail("bool did not convert to a bool in negated if statement."); + } + } + + template<> template<> + void SDTestObject::test<10>() + // map operations + { + SDCleanupCheck check; + + LLSD v; + ensure("undefined has no members", !v.has("amy")); + ensure("undefined get() is undefined", v.get("bob").isUndefined()); + + v = LLSD::emptyMap(); + ensure("empty map is a map", v.isMap()); + ensure("empty map has no members", !v.has("cam")); + ensure("empty map get() is undefined", v.get("don").isUndefined()); + + v.clear(); + v.insert("eli", 43); + ensure("insert converts to map", v.isMap()); + ensure("inserted key is present", v.has("eli")); + ensureTypeAndValue("inserted value", v.get("eli"), 43); + + v.insert("fra", false); + ensure("first key still present", v.has("eli")); + ensure("second key is present", v.has("fra")); + ensureTypeAndValue("first value", v.get("eli"), 43); + ensureTypeAndValue("second value", v.get("fra"), false); + + v.erase("eli"); + ensure("first key now gone", !v.has("eli")); + ensure("second key still present", v.has("fra")); + ensure("first value gone", v.get("eli").isUndefined()); + ensureTypeAndValue("second value sill there", v.get("fra"), false); + + v.erase("fra"); + ensure("second key now gone", !v.has("fra")); + ensure("second value gone", v.get("fra").isUndefined()); + + v["gil"] = (std::string)"good morning"; + ensure("third key present", v.has("gil")); + ensureTypeAndValue("third key value", v.get("gil"), "good morning"); + + const LLSD& cv = v; // FIX ME IF POSSIBLE + ensure("missing key", cv["ham"].isUndefined()); + ensure("key not present", !v.has("ham")); + + LLSD w = 43; + const LLSD& cw = w; // FIX ME IF POSSIBLE + int i = cw["ian"]; + ensureTypeAndValue("other missing value", i, 0); + ensure("other missing key", !w.has("ian")); + ensure("no conversion", w.isInteger()); + + LLSD x; + x = v; + ensure("copy map type", x.isMap()); + ensureTypeAndValue("copy map value gil", x.get("gil"), "good morning"); + } + + + template<> template<> + void SDTestObject::test<11>() + // array operations + { + SDCleanupCheck check; + + LLSD v; + ensure_equals("undefined has no size", v.size(), 0); + ensure("undefined get() is undefined", v.get(0).isUndefined()); + + v = LLSD::emptyArray(); + ensure("empty array is an array", v.isArray()); + ensure_equals("empty array has no size", v.size(), 0); + ensure("empty map get() is undefined", v.get(0).isUndefined()); + + v.clear(); + v.append(88); + v.append("noodle"); + v.append(true); + ensure_equals("appened array size", v.size(), 3); + ensure("append array is an array", v.isArray()); + ensureTypeAndValue("append 0", v[0], 88); + ensureTypeAndValue("append 1", v[1], "noodle"); + ensureTypeAndValue("append 2", v[2], true); + + v.insert(0, 77); + v.insert(2, "soba"); + v.insert(4, false); + ensure_equals("inserted array size", v.size(), 6); + ensureTypeAndValue("post insert 0", v[0], 77); + ensureTypeAndValue("post insert 1", v[1], 88); + ensureTypeAndValue("post insert 2", v[2], "soba"); + ensureTypeAndValue("post insert 3", v[3], "noodle"); + ensureTypeAndValue("post insert 4", v[4], false); + ensureTypeAndValue("post insert 5", v[5], true); + + ensureTypeAndValue("get 1", v.get(1), 88); + v.set(1, "hot"); + ensureTypeAndValue("set 1", v.get(1), "hot"); + + v.erase(3); + ensure_equals("post erase array size", v.size(), 5); + ensureTypeAndValue("post erase 0", v[0], 77); + ensureTypeAndValue("post erase 1", v[1], "hot"); + ensureTypeAndValue("post erase 2", v[2], "soba"); + ensureTypeAndValue("post erase 3", v[3], false); + ensureTypeAndValue("post erase 4", v[4], true); + + v.append(34); + ensure_equals("size after append", v.size(), 6); + ensureTypeAndValue("post append 5", v[5], 34); + + LLSD w; + w = v; + ensure("copy array type", w.isArray()); + ensure_equals("copy array size", w.size(), 6); + ensureTypeAndValue("copy array 0", w[0], 77); + ensureTypeAndValue("copy array 1", w[1], "hot"); + ensureTypeAndValue("copy array 2", w[2], "soba"); + ensureTypeAndValue("copy array 3", w[3], false); + ensureTypeAndValue("copy array 4", w[4], true); + ensureTypeAndValue("copy array 5", w[5], 34); + } + + + template<> template<> + void SDTestObject::test<12>() + // no sharing + { + SDCleanupCheck check; + + LLSD a = 99; + LLSD b = a; + a = 34; + ensureTypeAndValue("top level original changed", a, 34); + ensureTypeAndValue("top level copy unaltered", b, 99); + b = a; + b = 66; + ensureTypeAndValue("top level original unaltered", a, 34); + ensureTypeAndValue("top level copy changed", b, 66); + + a[0] = "uno"; + a[1] = 99; + a[2] = 1.414; + b = a; + a[1] = 34; + ensureTypeAndValue("array member original changed", a[1], 34); + ensureTypeAndValue("array member copy unaltered", b[1], 99); + b = a; + b[1] = 66; + ensureTypeAndValue("array member original unaltered", a[1], 34); + ensureTypeAndValue("array member copy changed", b[1], 66); + + a["alpha"] = "uno"; + a["beta"] = 99; + a["gamma"] = 1.414; + b = a; + a["beta"] = 34; + ensureTypeAndValue("map member original changed", a["beta"], 34); + ensureTypeAndValue("map member copy unaltered", b["beta"], 99); + b = a; + b["beta"] = 66; + ensureTypeAndValue("map member original unaltered", a["beta"], 34); + ensureTypeAndValue("map member copy changed", b["beta"], 66); + } + + template<> template<> + void SDTestObject::test<13>() + // sharing implementation + { + SDCleanupCheck check; + + { + SDAllocationCheck check("copy construct undefinded", 0); + LLSD v; + LLSD w = v; + } + + { + SDAllocationCheck check("assign undefined", 0); + LLSD v; + LLSD w; + w = v; + } + + { + SDAllocationCheck check("assign integer value", 1); + LLSD v = 45; + v = 33; + v = 0; + } + + { + SDAllocationCheck check("copy construct integer", 1); + LLSD v = 45; + LLSD w = v; + } + + { + SDAllocationCheck check("assign integer", 1); + LLSD v = 45; + LLSD w; + w = v; + } + + { + SDAllocationCheck check("avoids extra clone", 2); + LLSD v = 45; + LLSD w = v; + w = "nice day"; + } + } + + /* TO DO: + conversion of undefined to UUID, Date, URI and Binary + conversion of undefined to map and array + test map operations + test array operations + test array extension + + test copying and assign maps and arrays (clone) + test iteration over map + test iteration over array + test iteration over scalar + + test empty map and empty array are indeed shared + test serializations + */ +} + 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 @@ +/** + * @file llsdserialize_tut.cpp + * @date April 2006 + * @brief LLSDSerialize unit tests + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include +#include +#include + +#include "llsd.h" +#include "llsdserialize.h" +#include "lltut.h" + + +namespace tut +{ + struct sd_xml_data + { + sd_xml_data() + { + mFormatter = new LLSDXMLFormatter; + } + LLSD mSD; + LLPointer mFormatter; + void xml_test(const char* name, const std::string& expected) + { + std::ostringstream ostr; + mFormatter->format(mSD, ostr); + ensure_equals(name, ostr.str(), expected); + } + }; + + typedef test_group sd_xml_test; + typedef sd_xml_test::object sd_xml_object; + tut::sd_xml_test sd_xml_stream("sd_xml_serialization"); + + template<> template<> + void sd_xml_object::test<1>() + { + // random atomic tests + std::string expected; + + expected = "\n"; + xml_test("undef", expected); + + mSD = 3463; + expected = "3463\n"; + xml_test("integer", expected); + + mSD = ""; + expected = "\n"; + xml_test("empty string", expected); + + mSD = "foobar"; + expected = "foobar\n"; + xml_test("string", expected); + + mSD = LLUUID::null; + expected = "\n"; + xml_test("null uuid", expected); + + mSD = LLUUID("c96f9b1e-f589-4100-9774-d98643ce0bed"); + expected = "c96f9b1e-f589-4100-9774-d98643ce0bed\n"; + xml_test("uuid", expected); + + mSD = LLURI("https://secondlife.com/login"); + expected = "https://secondlife.com/login\n"; + xml_test("uri", expected); + + mSD = LLDate("2006-04-24T16:11:33Z"); + expected = "2006-04-24T16:11:33Z\n"; + xml_test("date", expected); + + // *FIX: test binary + } + + template<> template<> + void sd_xml_object::test<2>() + { + // tests with boolean values. + std::string expected; + + mFormatter->boolalpha(true); + mSD = true; + expected = "true\n"; + xml_test("bool alpha true", expected); + mSD = false; + expected = "false\n"; + xml_test("bool alpha false", expected); + + mFormatter->boolalpha(false); + mSD = true; + expected = "1\n"; + xml_test("bool true", expected); + mSD = false; + expected = "0\n"; + xml_test("bool false", expected); + } + + + template<> template<> + void sd_xml_object::test<3>() + { + // tests with real values. + std::string expected; + + mFormatter->realFormat("%.2f"); + mSD = 1.0; + expected = "1.00\n"; + xml_test("real 1", expected); + + mSD = -34379.0438; + expected = "-34379.04\n"; + xml_test("real reduced precision", expected); + mFormatter->realFormat("%.4f"); + expected = "-34379.0438\n"; + xml_test("higher precision", expected); + + mFormatter->realFormat("%.0f"); + mSD = 0.0; + expected = "0\n"; + xml_test("no decimal 0", expected); + mSD = 3287.4387; + expected = "3287\n"; + xml_test("no decimal real number", expected); + } + + template<> template<> + void sd_xml_object::test<4>() + { + // tests with arrays + std::string expected; + + mSD = LLSD::emptyArray(); + expected = "\n"; + xml_test("empty array", expected); + + mSD.append(LLSD()); + expected = "\n"; + xml_test("1 element array", expected); + + mSD.append(1); + expected = "1\n"; + xml_test("2 element array", expected); + } + + template<> template<> + void sd_xml_object::test<5>() + { + // tests with arrays + std::string expected; + + mSD = LLSD::emptyMap(); + expected = "\n"; + xml_test("empty map", expected); + + mSD["foo"] = "bar"; + expected = "foobar\n"; + xml_test("1 element map", expected); + + mSD["baz"] = LLSD(); + expected = "bazfoobar\n"; + xml_test("2 element map", expected); + } + + + class TestLLSDSerializeData + { + public: + TestLLSDSerializeData(); + ~TestLLSDSerializeData(); + + void doRoundTripTests(const std::string&); + void checkRoundTrip(const std::string&, const LLSD& v); + + LLPointer mFormatter; + LLPointer mParser; + }; + + TestLLSDSerializeData::TestLLSDSerializeData() + { + } + + TestLLSDSerializeData::~TestLLSDSerializeData() + { + } + + void TestLLSDSerializeData::checkRoundTrip(const std::string& msg, const LLSD& v) + { + std::stringstream stream; + mFormatter->format(v, stream); + LLSD w; + mParser->parse(stream, w); + + try + { + ensure_equals(msg, w, v); + } + catch (...) + { + std::cerr << "the serialized string was:" << std::endl; + std::cerr << stream.str() << std::endl; + throw; + } + } + + void TestLLSDSerializeData::doRoundTripTests(const std::string& msg) + { + LLSD v; + checkRoundTrip(msg + " undefined", v); + + v = true; + checkRoundTrip(msg + " true bool", v); + + v = false; + checkRoundTrip(msg + " false bool", v); + + v = 1; + checkRoundTrip(msg + " positive int", v); + + v = 0; + checkRoundTrip(msg + " zero int", v); + + v = -1; + checkRoundTrip(msg + " negative int", v); + + v = 1234.5f; + checkRoundTrip(msg + " positive float", v); + + v = 0.0f; + checkRoundTrip(msg + " zero float", v); + + v = -1234.5f; + checkRoundTrip(msg + " negative float", v); + + // FIXME: need a NaN test + + v = LLUUID::null; + checkRoundTrip(msg + " null uuid", v); + + LLUUID newUUID; + newUUID.generate(); + v = newUUID; + checkRoundTrip(msg + " new uuid", v); + + v = ""; + checkRoundTrip(msg + " empty string", v); + + v = "some string"; + checkRoundTrip(msg + " non-empty string", v); + + v = +"Second Life is a 3-D virtual world entirely built and owned by its residents. " +"Since opening to the public in 2003, it has grown explosively and today is " +"inhabited by nearly 100,000 people from around the globe.\n" +"\n" +"From the moment you enter the World you’ll discover a vast digital continent, " +"teeming with people, entertainment, experiences and opportunity. Once you’ve " +"explored a bit, perhaps you’ll find a perfect parcel of land to build your " +"house or business.\n" +"\n" +"You’ll also be surrounded by the Creations of your fellow residents. Because " +"residents retain the rights to their digital creations, they can buy, sell " +"and trade with other residents.\n" +"\n" +"The Marketplace currently supports millions of US dollars in monthly " +"transactions. This commerce is handled with the in-world currency, the Linden " +"dollar, which can be converted to US dollars at several thriving online " +"currency exchanges.\n" +"\n" +"Welcome to Second Life. We look forward to seeing you in-world!\n" + ; + checkRoundTrip(msg + " long string", v); + + static const U32 block_size = 0x000020; + for (U32 block = 0x000000; block <= 0x10ffff; block += block_size) + { + std::ostringstream out; + + for (U32 c = block; c < block + block_size; ++c) + { + if (c <= 0x000001f + && c != 0x000009 + && c != 0x00000a) + { + // see XML standard, sections 2.2 and 4.1 + continue; + } + if (0x00d800 <= c && c <= 0x00dfff) { continue; } + if (0x00fdd0 <= c && c <= 0x00fdef) { continue; } + if ((c & 0x00fffe) == 0x00fffe) { continue; } + // see Unicode standard, section 15.8 + + if (c <= 0x00007f) + { + out << (char)(c & 0x7f); + } + else if (c <= 0x0007ff) + { + out << (char)(0xc0 | ((c >> 6) & 0x1f)); + out << (char)(0x80 | ((c >> 0) & 0x3f)); + } + else if (c <= 0x00ffff) + { + out << (char)(0xe0 | ((c >> 12) & 0x0f)); + out << (char)(0x80 | ((c >> 6) & 0x3f)); + out << (char)(0x80 | ((c >> 0) & 0x3f)); + } + else + { + out << (char)(0xf0 | ((c >> 18) & 0x07)); + out << (char)(0x80 | ((c >> 12) & 0x3f)); + out << (char)(0x80 | ((c >> 6) & 0x3f)); + out << (char)(0x80 | ((c >> 0) & 0x3f)); + } + } + + v = out.str(); + + std::ostringstream blockmsg; + blockmsg << msg << " unicode string block 0x" << std::hex << block; + checkRoundTrip(blockmsg.str(), v); + } + + LLDate epoch; + v = epoch; + checkRoundTrip(msg + " epoch date", v); + + LLDate aDay("2002-12-07T05:07:15.00Z"); + v = aDay; + checkRoundTrip(msg + " date", v); + + LLURI path("http://slurl.com/secondlife/Ambleside/57/104/26/"); + v = path; + checkRoundTrip(msg + " url", v); + + const char source[] = "it must be a blue moon again"; + std::vector data; + copy(&source[0], &source[sizeof(source)], back_inserter(data)); + + v = data; + checkRoundTrip(msg + " binary", v); + + v = LLSD::emptyMap(); + checkRoundTrip(msg + " empty map", v); + + v = LLSD::emptyMap(); + v["name"] = "luke"; //v.insert("name", "luke"); + v["age"] = 3; //v.insert("age", 3); + checkRoundTrip(msg + " map", v); + + v.clear(); + v["a"]["1"] = true; + v["b"]["0"] = false; + checkRoundTrip(msg + " nested maps", v); + + v = LLSD::emptyArray(); + checkRoundTrip(msg + " empty array", v); + + v = LLSD::emptyArray(); + v.append("ali"); + v.append(28); + checkRoundTrip(msg + " array", v); + + v.clear(); + v[0][0] = true; + v[1][0] = false; + checkRoundTrip(msg + " nested arrays", v); + } + + typedef tut::test_group TestLLSDSerialzeGroup; + typedef TestLLSDSerialzeGroup::object TestLLSDSerializeObject; + TestLLSDSerialzeGroup gTestLLSDSerializeGroup("llsd serialization"); + + template<> template<> + void TestLLSDSerializeObject::test<1>() + { + mFormatter = new LLSDNotationFormatter(); + mParser = new LLSDNotationParser(); + doRoundTripTests("notation serialization"); + } + + template<> template<> + void TestLLSDSerializeObject::test<2>() + { + mFormatter = new LLSDXMLFormatter(); + mParser = new LLSDXMLParser(); + doRoundTripTests("xml serialization"); + } + + template<> template<> + void TestLLSDSerializeObject::test<3>() + { + mFormatter = new LLSDBinaryFormatter(); + mParser = new LLSDBinaryParser(); + doRoundTripTests("binary serialization"); + } + + + + + class TestLLSDXMLParsing + { + public: + TestLLSDXMLParsing() + { + mParser = new LLSDXMLParser; + } + void ensureParse(const std::string& msg, const char* xml, const LLSD& expected); + + LLPointer mParser; + }; + + void TestLLSDXMLParsing::ensureParse( + const std::string& msg, const char* xmlstring, const LLSD& expected) + { + std::stringstream input; + input.str(xmlstring); + + LLSD parsedResult; + mParser->parse(input, parsedResult); + + ensure_equals(msg, parsedResult, expected); + } + + + typedef tut::test_group TestLLSDXMLParsingGroup; + typedef TestLLSDXMLParsingGroup::object TestLLSDXMLParsingObject; + TestLLSDXMLParsingGroup gTestLLSDXMLParsingGroup("llsd XML parsing"); + + template<> template<> + void TestLLSDXMLParsingObject::test<1>() + { + // test handling of xml not recognized as llsd results in an LLSD Undefined" + + ensureParse("malformed xml", "ha ha", LLSD()); + ensureParse("not llsd", "

ha ha

", LLSD()); + ensureParse("value without llsd", "ha ha", LLSD()); + ensureParse("key without llsd", "ha ha", LLSD()); + } + + + template<> template<> + void TestLLSDXMLParsingObject::test<2>() + { + // test handling of unrecognized or unparseable llsd values + + LLSD v; + v["amy"] = 23; + v["bob"] = LLSD(); + v["cam"] = 1.23; + + ensureParse("unknown data type", + "" + "amy23" + "bob99999999999999999" + "cam1.23" + "", v); + } + + template<> template<> + void TestLLSDXMLParsingObject::test<3>() + { + // test handling of nested bad data + + LLSD v; + v["amy"] = 23; + v["cam"] = 1.23; + + ensureParse("map with html", + "" + "amy23" + "ha ha" + "cam1.23" + "", v); + + v.clear(); + v["amy"] = 23; + v["cam"] = 1.23; + ensureParse("map with value for key", + "" + "amy23" + "ha ha" + "cam1.23" + "", v); + + v.clear(); + v["amy"] = 23; + v["bob"] = LLSD::emptyMap(); + v["cam"] = 1.23; + ensureParse("map with map of html", + "" + "amy23" + "bob" + "" + "ha ha" + "" + "cam1.23" + "", v); + + v.clear(); + v[0] = 23; + v[1] = LLSD(); + v[2] = 1.23; + + ensureParse("array value of html", + "" + "23" + "ha ha" + "1.23" + "", v); + + v.clear(); + v[0] = 23; + v[1] = LLSD::emptyMap(); + v[2] = 1.23; + ensureParse("array with map of html", + "" + "23" + "" + "ha ha" + "" + "1.23" + "", v); + } + + + /* + TODO: + test XML parsing + binary with unrecognized encoding + nested LLSD tags + multiple values inside an LLSD + */ +} 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 @@ +/** + * @file lltiming_tut.cpp + * @date 2006-07-23 + * @brief Tests the timers. + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include "linden_common.h" +#include "lltut.h" + +#include "llframetimer.h" +#include "llsd.h" + +namespace tut +{ + struct frametimer_test + { + frametimer_test() + { + LLFrameTimer::updateFrameTime(); + } + }; + typedef test_group frametimer_group_t; + typedef frametimer_group_t::object frametimer_object_t; + tut::frametimer_group_t frametimer_instance("frametimer"); + + template<> template<> + void frametimer_object_t::test<1>() + { + F64 seconds_since_epoch = LLFrameTimer::getTotalSeconds(); + LLFrameTimer timer; + timer.setExpiryAt(seconds_since_epoch); + F64 expires_at = timer.expiresAt(); + ensure_distance( + "set expiry matches get expiry", + expires_at, + seconds_since_epoch, + 0.001); + } + + template<> template<> + void frametimer_object_t::test<2>() + { + F64 seconds_since_epoch = LLFrameTimer::getTotalSeconds(); + seconds_since_epoch += 10.0; + LLFrameTimer timer; + timer.setExpiryAt(seconds_since_epoch); + F64 expires_at = timer.expiresAt(); + ensure_distance( + "set expiry matches get expiry 1", + expires_at, + seconds_since_epoch, + 0.001); + seconds_since_epoch += 10.0; + timer.setExpiryAt(seconds_since_epoch); + expires_at = timer.expiresAt(); + ensure_distance( + "set expiry matches get expiry 2", + expires_at, + seconds_since_epoch, + 0.001); + } + template<> template<> + void frametimer_object_t::test<3>() + { + F64 seconds_since_epoch = LLFrameTimer::getTotalSeconds(); + seconds_since_epoch += 2.0; + LLFrameTimer timer; + timer.setExpiryAt(seconds_since_epoch); + ensure("timer not expired on create", !timer.hasExpired()); + int ii; + for(ii = 0; ii < 10; ++ii) + { + ms_sleep(150); + LLFrameTimer::updateFrameTime(); + } + ensure("timer not expired after a bit", !timer.hasExpired()); + for(ii = 0; ii < 10; ++ii) + { + ms_sleep(100); + LLFrameTimer::updateFrameTime(); + } + ensure("timer expired", timer.hasExpired()); + } +/* + template<> template<> + void frametimer_object_t::test<4>() + { + } +*/ +} 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 @@ +/** + * @file lltut.cpp + * @author Mark Lentczner + * @date 5/16/06 + * @brief MacTester + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include "lltut.h" +#include "llsd.h" + +namespace tut +{ + template<> + void ensure_equals(const char* msg, const LLDate& actual, + const LLDate& expected) + { + ensure_equals(msg, + actual.secondsSinceEpoch(), expected.secondsSinceEpoch()); + } + + template<> + void ensure_equals(const char* msg, const LLURI& actual, + const LLURI& expected) + { + ensure_equals(msg, + actual.asString(), expected.asString()); + } + + template<> + void ensure_equals(const char* msg, + const std::vector& actual, const std::vector& expected) + { + std::string s(msg); + + ensure_equals(s + " size", actual.size(), expected.size()); + + std::vector::const_iterator i, j; + int k; + for (i = actual.begin(), j = expected.begin(), k = 0; + i != actual.end(); + ++i, ++j, ++k) + { + ensure_equals(s + " field", *i, *j); + } + } + + template<> + void ensure_equals(const char* m, const LLSD& actual, + const LLSD& expected) + { + const std::string& msg = m; + + ensure_equals(msg + " type", actual.type(), expected.type()); + switch (actual.type()) + { + case LLSD::TypeUndefined: + return; + + case LLSD::TypeBoolean: + ensure_equals(msg + " boolean", actual.asBoolean(), expected.asBoolean()); + return; + + case LLSD::TypeInteger: + ensure_equals(msg + " integer", actual.asInteger(), expected.asInteger()); + return; + + case LLSD::TypeReal: + ensure_equals(msg + " real", actual.asReal(), expected.asReal()); + return; + + case LLSD::TypeString: + ensure_equals(msg + " string", actual.asString(), expected.asString()); + return; + + case LLSD::TypeUUID: + ensure_equals(msg + " uuid", actual.asUUID(), expected.asUUID()); + return; + + case LLSD::TypeDate: + ensure_equals(msg + " date", actual.asDate(), expected.asDate()); + return; + + case LLSD::TypeURI: + ensure_equals(msg + " uri", actual.asURI(), expected.asURI()); + return; + + case LLSD::TypeBinary: + ensure_equals(msg + " binary", actual.asBinary(), expected.asBinary()); + return; + + case LLSD::TypeMap: + { + ensure_equals(msg + " map size", actual.size(), expected.size()); + + LLSD::map_const_iterator actual_iter = actual.beginMap(); + LLSD::map_const_iterator expected_iter = expected.beginMap(); + + while(actual_iter != actual.endMap()) + { + ensure_equals(msg + " map keys", + actual_iter->first, expected_iter->first); + ensure_equals(msg + "[" + actual_iter->first + "]", + actual_iter->second, expected_iter->second); + ++actual_iter; + ++expected_iter; + } + return; + } + case LLSD::TypeArray: + { + ensure_equals(msg + " array size", actual.size(), expected.size()); + + for(int i = 0; i < actual.size(); ++i) + { + ensure_equals(msg + llformat("[%d]", i), + actual[i], expected[i]); + } + return; + } + } + } + + void ensure_starts_with(const std::string& msg, + const std::string& actual, const std::string& expectedStart) + { + if( actual.find(expectedStart, 0) != 0 ) + { + std::stringstream ss; + ss << msg << ": " << "expected to find " << expectedStart + << " at start of actual " << actual; + throw failure(ss.str().c_str()); + } + } + + void ensure_contains(const std::string& msg, + const std::string& actual, const std::string& expectedSubString) + { + if( actual.find(expectedSubString, 0) == std::string::npos ) + { + std::stringstream ss; + ss << msg << ": " << "expected to find " << expectedSubString + << " in actual " << actual; + throw failure(ss.str().c_str()); + } + } +} 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 @@ +/** + * @file lltut.h + * @author Phoenix + * @date 2005-09-26 + * @brief helper tut methods + * + * Copyright (c) 2005-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +/** + * + * THOROUGH_DESCRIPTION + * + */ + +#ifndef LL_LLTUT_H +#define LL_LLTUT_H + +#include + +#include "lldate.h" +#include "lluri.h" + +class LLSD; + +namespace tut +{ + template + void ensure_not_equals(const char* msg,const Q& actual,const T& expected) + { + if( expected == actual ) + { + std::stringstream ss; + ss << (msg?msg:"") << (msg?": ":"") << "both equal " << expected; + throw tut::failure(ss.str().c_str()); + } + } + + template + void ensure_not_equals(const Q& actual,const T& expected) + { + ensure_not_equals(NULL, actual, expected); + } + + + template + void ensure_equals(const std::string& msg, + const Q& actual,const T& expected) + { ensure_equals(msg.c_str(), actual, expected); } + + template<> + void ensure_equals(const char* msg, + const LLDate& actual, const LLDate& expected); + + template<> + void ensure_equals(const char* msg, + const LLURI& actual, const LLURI& expected); + + template<> + void ensure_equals(const char* msg, + const std::vector& actual, const std::vector& expected); + + template<> + void ensure_equals(const char* msg, + const LLSD& actual, const LLSD& expected); + + void ensure_starts_with(const std::string& msg, + const std::string& actual, const std::string& expectedStart); + + void ensure_contains(const std::string& msg, + const std::string& actual, const std::string& expectedSubString); +} + + +#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 @@ +/** + * @file lluri_tut.cpp + * @brief LLURI unit tests + * @date September 2006 + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include +#include "lltut.h" + +#include "llsd.h" +#include "lluri.h" +#include "llhost.h" + +namespace tut +{ + struct URITestData { + void checkParts(const std::string& uriString, + const char* expectedScheme, + const char* expectedOpaque, + const char* expectedAuthority, + const char* expectedPath, + const char* expectedQuery) + { + LLURI u(uriString); + + ensure_equals("scheme", u.scheme(), expectedScheme); + ensure_equals("opaque", u.opaque(), expectedOpaque); + ensure_equals("authority", u.authority(), expectedAuthority); + ensure_equals("path", u.path(), expectedPath); + ensure_equals("query", u.query(), expectedQuery); + } + + void checkPartsHTTP(const char* host_and_port, + const LLSD& path, + const char* expectedOpaque, + const char* expectedAuthority, + const char* expectedPath) + { + LLURI u = LLURI::buildHTTP(host_and_port, path); + ensure_equals("scheme", u.scheme(), "HTTP"); + ensure_equals("opaque", u.opaque(), expectedOpaque); + ensure_equals("authority", u.authority(), expectedAuthority); + ensure_equals("path", u.path(), expectedPath); + ensure_equals("query", u.query(), ""); + } + + void checkPartsHTTP(const char* host_and_port, + const LLSD& path, + const LLSD& args, + const char* expectedOpaque, + const char* expectedAuthority, + const char* expectedPath, + const char* expectedQuery) + { + LLURI u = LLURI::buildHTTP(host_and_port, path, args); + ensure_equals("scheme", u.scheme(), "HTTP"); + ensure_equals("opaque", u.opaque(), expectedOpaque); + ensure_equals("authority", u.authority(), expectedAuthority); + ensure_equals("path", u.path(), expectedPath); + ensure_equals("query", u.query(), expectedQuery); + } + }; + + typedef test_group URITestGroup; + typedef URITestGroup::object URITestObject; + + URITestGroup uriTestGroup("LLURI"); + + template<> template<> + void URITestObject::test<1>() + { + LLURI u("http://abc.com/def/ghi?x=37&y=hello"); + + ensure_equals("scheme", u.scheme(), "http"); + ensure_equals("authority", u.authority(), "abc.com"); + ensure_equals("path", u.path(), "/def/ghi"); + ensure_equals("query", u.query(), "x=37&y=hello"); + + ensure_equals("host name", u.hostName(), "abc.com"); + ensure_equals("host port", u.hostPort(), 80); + + LLSD query = u.queryMap(); + ensure_equals("query x", query["x"].asInteger(), 37); + ensure_equals("query y", query["y"].asString(), "hello"); + + query = LLURI::queryMap("x=22.23&y=https://lindenlab.com/"); + ensure_equals("query x", query["x"].asReal(), 22.23); + ensure_equals("query y", query["y"].asURI().asString(), "https://lindenlab.com/"); + } + + template<> template<> + void URITestObject::test<2>() + { + // empty string + checkParts("", "", "", "", "", ""); + } + + template<> template<> + void URITestObject::test<3>() + { + // no scheme + checkParts("foo", "", "foo", "", "", ""); + checkParts("foo%3A", "", "foo:", "", "", ""); + } + + template<> template<> + void URITestObject::test<4>() + { + // scheme w/o paths + checkParts("mailto:zero@ll.com", "mailto", "zero@ll.com", "", "", ""); + checkParts("silly://abc/def?foo", "silly", "//abc/def?foo", "", "", ""); + } + + template<> template<> + void URITestObject::test<5>() + { + // authority section + checkParts("http:///", "http", "///", "", "/", ""); + checkParts("http://abc", "http", "//abc", "abc", "", ""); + checkParts("http://a%2Fb/cd", "http", "//a/b/cd", "a/b", "/cd", ""); + checkParts("http://host?", "http", "//host?", "host", "", ""); + } + + template<> template<> + void URITestObject::test<6>() + { + // path section + checkParts("http://host/a/b/", "http", "//host/a/b/", + "host", "/a/b/", ""); + checkParts("http://host/a%3Fb/", "http", "//host/a?b/", + "host", "/a?b/", ""); + checkParts("http://host/a:b/", "http", "//host/a:b/", + "host", "/a:b/", ""); + } + + template<> template<> + void URITestObject::test<7>() + { + // query string + checkParts("http://host/?", "http", "//host/?", + "host", "/", ""); + checkParts("http://host/?x", "http", "//host/?x", + "host", "/", "x"); + checkParts("http://host/??", "http", "//host/??", + "host", "/", "?"); + checkParts("http://host/?%3F", "http", "//host/??", + "host", "/", "?"); + } + + template<> template<> + void URITestObject::test<8>() + { + LLSD path; + path.append("x"); + path.append("123"); + checkPartsHTTP("host", path, "//host/x/123", "//host", "/x/123"); + LLSD query; + query["123"] = "12"; + query["abcd"] = "abc"; + checkPartsHTTP("host", path, query, "//host/x/123?123=12&abcd=abc&", "//host", "/x/123", "123=12&abcd=abc&"); + } + + template<> template<> + void URITestObject::test<9>() + { + // test unescaped path components + LLSD path; + path.append("x@*//*$&^"); + path.append("123"); + checkPartsHTTP("host", path, "//host/x@*//*$&^/123", "//host", "/x@*//*$&^/123"); + } + + template<> template<> + void URITestObject::test<10>() + { + // test unescaped query components + LLSD path; + path.append("x"); + path.append("123"); + LLSD query; + query["123"] = "?&*#//"; + query["**@&?//"] = "abc"; + checkPartsHTTP("host", path, query, "//host/x/123?**@&?//=abc&123=?&*#//&", "//host", "/x/123", "**@&?//=abc&123=?&*#//&"); + } + + template<> template<> + void URITestObject::test<11>() + { + // test unescaped host components + LLSD path; + path.append("x"); + path.append("123"); + LLSD query; + query["123"] = "12"; + query["abcd"] = "abc"; + checkPartsHTTP("hi123*33--}{:portstuffs", path, query, "//hi123*33--}{:portstuffs/x/123?123=12&abcd=abc&", "//hi123*33--}{:portstuffs", "/x/123", "123=12&abcd=abc&"); + } +} + 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 @@ +/** + * @file lluserrelations_tut.cpp + * @author Phoenix + * @date 2006-10-12 + * @brief Unit tests for the LLRelationship class. + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include + +#include "linden_common.h" +#include "lluserrelations.h" + +namespace tut +{ + struct user_relationship + { + LLRelationship mRelationship; + }; + typedef test_group user_relationship_t; + typedef user_relationship_t::object user_relationship_object_t; + tut::user_relationship_t tut_user_relationship("relationships"); + + template<> template<> + void user_relationship_object_t::test<1>() + { + // Test the default construction + ensure( + "No granted rights to", + !mRelationship.isRightGrantedTo( + LLRelationship::GRANT_ONLINE_STATUS)); + ensure( + "No granted rights from", + !mRelationship.isRightGrantedFrom( + LLRelationship::GRANT_ONLINE_STATUS)); + ensure("No online status",!mRelationship.isOnline()); + } + + template<> template<> + void user_relationship_object_t::test<2>() + { + // Test some granting + mRelationship.grantRights( + LLRelationship::GRANT_ONLINE_STATUS, + LLRelationship::GRANT_MODIFY_OBJECTS); + ensure( + "Granted rights to has online", + mRelationship.isRightGrantedTo( + LLRelationship::GRANT_ONLINE_STATUS)); + ensure( + "Granted rights from does not have online", + !mRelationship.isRightGrantedFrom( + LLRelationship::GRANT_ONLINE_STATUS)); + ensure( + "Granted rights to does not have modify", + !mRelationship.isRightGrantedTo( + LLRelationship::GRANT_MODIFY_OBJECTS)); + ensure( + "Granted rights from has modify", + mRelationship.isRightGrantedFrom( + LLRelationship::GRANT_MODIFY_OBJECTS)); + } + + template<> template<> + void user_relationship_object_t::test<3>() + { + // Test revoking + mRelationship.grantRights( + LLRelationship::GRANT_ONLINE_STATUS + | LLRelationship::GRANT_MAP_LOCATION, + LLRelationship::GRANT_ONLINE_STATUS); + ensure( + "Granted rights to has online and map", + mRelationship.isRightGrantedTo( + LLRelationship::GRANT_ONLINE_STATUS + | LLRelationship::GRANT_MAP_LOCATION)); + ensure( + "Granted rights from has online", + mRelationship.isRightGrantedFrom( + LLRelationship::GRANT_ONLINE_STATUS)); + + mRelationship.revokeRights( + LLRelationship::GRANT_MAP_LOCATION, + LLRelationship::GRANT_NONE); + ensure( + "Granted rights revoked map", + !mRelationship.isRightGrantedTo( + LLRelationship::GRANT_ONLINE_STATUS + | LLRelationship::GRANT_MAP_LOCATION)); + ensure( + "Granted rights revoked still has online", + mRelationship.isRightGrantedTo( + LLRelationship::GRANT_ONLINE_STATUS)); + + mRelationship.grantRights( + LLRelationship::GRANT_NONE, + LLRelationship::GRANT_MODIFY_OBJECTS); + ensure( + "Granted rights from still has online", + mRelationship.isRightGrantedFrom( + LLRelationship::GRANT_ONLINE_STATUS)); + ensure( + "Granted rights from has full grant", + mRelationship.isRightGrantedFrom( + LLRelationship::GRANT_ONLINE_STATUS + | LLRelationship::GRANT_MODIFY_OBJECTS)); + mRelationship.revokeRights( + LLRelationship::GRANT_NONE, + LLRelationship::GRANT_MODIFY_OBJECTS); + ensure( + "Granted rights from still has online", + mRelationship.isRightGrantedFrom( + LLRelationship::GRANT_ONLINE_STATUS)); + ensure( + "Granted rights from no longer modify", + !mRelationship.isRightGrantedFrom( + LLRelationship::GRANT_MODIFY_OBJECTS)); + } + + template<> template<> + void user_relationship_object_t::test<4>() + { + ensure("No online status", !mRelationship.isOnline()); + mRelationship.online(true); + ensure("Online status", mRelationship.isOnline()); + mRelationship.online(false); + ensure("No online status", !mRelationship.isOnline()); + } + +/* + template<> template<> + void user_relationship_object_t::test<>() + { + } +*/ +} 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 @@ +/** + * @file math.cpp + * @author Phoenix + * @date 2005-09-26 + * @brief Tests for the llmath library. + * + * Copyright (c) 2005-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include "linden_common.h" +#include "lltut.h" + +#include "llmath.h" +#include "lluuid.h" + +namespace tut +{ + struct math_data + { + }; + typedef test_group math_test; + typedef math_test::object math_object; + tut::math_test tm("basic_linden_math"); + + template<> template<> + void math_object::test<1>() + { + S32 val = 89543; + val = llabs(val); + ensure("integer absolute value 1", (89543 == val)); + val = -500; + val = llabs(val); + ensure("integer absolute value 2", (500 == val)); + } + + template<> template<> + void math_object::test<2>() + { + F32 val = -2583.4f; + val = llabs(val); + ensure("float absolute value 1", (2583.4f == val)); + val = 430903.f; + val = llabs(val); + ensure("float absolute value 2", (430903.f == val)); + } + + template<> template<> + void math_object::test<3>() + { + F64 val = 387439393.987329839; + val = llabs(val); + ensure("double absolute value 1", (387439393.987329839 == val)); + val = -8937843.9394878; + val = llabs(val); + ensure("double absolute value 2", (8937843.9394878 == val)); + } +} + +namespace tut +{ + struct uuid_data + { + LLUUID id; + }; + typedef test_group uuid_test; + typedef uuid_test::object uuid_object; + tut::uuid_test tu("uuid"); + + template<> template<> + void uuid_object::test<1>() + { + ensure("uuid null", id.isNull()); + id.generate(); + ensure("generate not null", id.notNull()); + id.setNull(); + ensure("set null", id.isNull()); + } + + template<> template<> + void uuid_object::test<2>() + { + id.generate(); + LLUUID a(id); + ensure_equals("copy equal", id, a); + a.generate(); + ensure_not_equals("generate not equal", id, a); + a = id; + ensure_equals("assignment equal", id, a); + } + + template<> template<> + void uuid_object::test<3>() + { + id.generate(); + LLUUID copy(id); + LLUUID mask; + mask.generate(); + copy ^= mask; + ensure_not_equals("mask not equal", id, copy); + copy ^= mask; + ensure_equals("mask back", id, copy); + } + + template<> template<> + void uuid_object::test<4>() + { + id.generate(); + LLString id_str = id.getString(); + LLUUID copy(id_str.c_str()); + ensure_equals("string serialization", id, copy); + } + +} 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 @@ +/** + * @file reflection_tut.cpp + * @date May 2006 + * @brief Reflection unit tests. + * + * Copyright (c) 2006-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +#include + +#include "lltut.h" +#include "reflective.h" +#include "metaclasst.h" +#include "metapropertyt.h" +//#include "referencemetaproperty.h" +#include "stdtypes.h" +//#include "reflectivemetapropertyt.h" + +namespace tut +{ + class TestAggregatedData : public LLReflective + { + public: + TestAggregatedData() {;} + virtual const LLMetaClass& getMetaClass() const; + + private: + }; + + class TestReflectionData : public LLReflective + { + public: + TestReflectionData() : mInt(42), mString("foo"), mNullPtr(NULL), mPtr(new TestAggregatedData()), mRef(*(new TestAggregatedData)) {;} + virtual ~TestReflectionData() {delete mPtr;} + virtual const LLMetaClass& getMetaClass() const; + + static U32 getPropertyCount() {return 5;} + + private: + + friend class LLMetaClassT; + S32 mInt; + std::string mString; + TestAggregatedData* mNullPtr; + TestAggregatedData* mPtr; + TestAggregatedData mObj; + TestAggregatedData& mRef; + }; +} + +template <> +void LLMetaClassT::reflectProperties(LLMetaClass& meta_class) +{ + reflectProperty(meta_class, "mInt", &tut::TestReflectionData::mInt); + reflectProperty(meta_class, "mString", &tut::TestReflectionData::mString); + reflectPtrProperty(meta_class, "mNullPtr", &tut::TestReflectionData::mNullPtr); + reflectPtrProperty(meta_class, "mPtr", &tut::TestReflectionData::mPtr); + reflectProperty(meta_class, "mObj", &tut::TestReflectionData::mObj); + //reflectProperty(meta_class, "mRef", &tut::TestReflectionData::mRef); // AARGH! +} + +namespace tut +{ + // virtual + const LLMetaClass& TestReflectionData::getMetaClass() const + { + return LLMetaClassT::instance(); + } + + const LLMetaClass& TestAggregatedData::getMetaClass() const + { + return LLMetaClassT::instance(); + } +} + +namespace tut +{ + typedef tut::test_group TestReflectionGroup; + typedef TestReflectionGroup::object TestReflectionObject; + TestReflectionGroup gTestReflectionGroup("reflection"); + + template<> template<> + void TestReflectionObject::test<1>() + { + // Check properties can be found. + const LLMetaClass& meta_class = LLMetaClassT::instance(); + const LLMetaProperty* null = NULL; + ensure_not_equals(meta_class.findProperty("mInt"), null); + ensure_not_equals(meta_class.findProperty("mString"), null); + } + + template<> template<> + void TestReflectionObject::test<2>() + { + // Check non-existent property cannot be found. + const LLMetaClass& meta_class = LLMetaClassT::instance(); + const LLMetaProperty* null = NULL; + ensure_equals(meta_class.findProperty("foo"), null); + } + + template<> template<> + void TestReflectionObject::test<3>() + { + // Check integer property has correct value. + const LLMetaClass& meta_class = LLMetaClassT::instance(); + ensure_equals(meta_class.findProperty("mInt")->getLLSD(this).asInteger(), 42); + } + + template<> template<> + void TestReflectionObject::test<4>() + { + // Check string property has correct value. + const LLMetaClass& meta_class = LLMetaClassT::instance(); + ensure_equals(meta_class.findProperty("mString")->getLLSD(this).asString(), std::string("foo")); + } + + template<> template<> + void TestReflectionObject::test<5>() + { + // Check NULL reference property has correct value. + const LLMetaClass& meta_class = LLMetaClassT::instance(); + const LLReflective* null = NULL; + ensure_equals(meta_class.findProperty("mNullPtr")->get(this), null); + } + + template<> template<> + void TestReflectionObject::test<6>() + { + // Check reference property has correct value. + const LLMetaClass& meta_class = LLMetaClassT::instance(); + const LLReflective* null = NULL; + const LLReflective* ref = meta_class.findProperty("mPtr")->get(this); + ensure_not_equals(ref, null); + } + + template<> template<> + void TestReflectionObject::test<7>() + { + // Check reflective property has correct value. + const LLMetaClass& meta_class = LLMetaClassT::instance(); + const LLReflective* null = NULL; + const LLReflective* ref = meta_class.findProperty("mObj")->get(this); + ensure_not_equals(ref, null); + } + + template<> template<> + void TestReflectionObject::test<8>() + { + // Check property count. + const LLMetaClass& meta_class = LLMetaClassT::instance(); + ensure_equals(meta_class.getPropertyCount(), TestReflectionData::getPropertyCount()); + } + + template<> template<> + void TestReflectionObject::test<9>() + { + // Check property iteration. + const LLMetaClass& meta_class = LLMetaClassT::instance(); + U32 count = 0; + LLMetaClass::PropertyIterator iter; + for(iter = meta_class.beginProperties(); iter != meta_class.endProperties(); ++iter) + { + ++count; + } + ensure_equals(count, TestReflectionData::getPropertyCount()); + } + + template<> template<> + void TestReflectionObject::test<10>() + { + // Check meta classes of different types do not compare equal. + const LLMetaClass* reflection_data_meta_class = &(LLMetaClassT::instance()); + const LLMetaClass* aggregated_data_meta_class = &(LLMetaClassT::instance()); + ensure_not_equals(reflection_data_meta_class, aggregated_data_meta_class); + } + + template<> template<> + void TestReflectionObject::test<11>() + { + // Check class cast checks. + const LLMetaClass& meta_class = LLMetaClassT::instance(); + TestAggregatedData* aggregated_data = new TestAggregatedData(); + LLMetaClass::PropertyIterator iter; + U32 exception_count = 0; + for(iter = meta_class.beginProperties(); iter != meta_class.endProperties(); ++iter) + { + try + { + const LLMetaProperty* property = (*iter).second; + const LLReflective* reflective = property->get(aggregated_data); // Wrong reflective type, should throw exception. + + // useless op to get rid of compiler warning. + reflective = NULL; + } + catch(...) + { + ++exception_count; + } + } + ensure_equals(exception_count, getPropertyCount()); + + } +} 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 @@ +/** + * @file test.cpp + * @author Phoenix + * @date 2005-09-26 + * @brief Entry point for the test app. + * + * Copyright (c) 2005-2007, Linden Research, Inc. + * + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + */ + +/** + * + * You can add tests by creating a new cpp file in this directory, and + * rebuilding. There are at most 50 tests per testgroup without a + * little bit of template parameter and makefile tweaking. + * + */ + +#include "linden_common.h" +#include "lltut.h" + +#include +#include + +// the CTYPE_WORKAROUND is needed for linux dev stations that don't +// have the broken libc6 packages needed by our out-of-date static +// libs (such as libcrypto and libcurl). -- Leviathan 20060113 +#ifdef CTYPE_WORKAROUND +# include "ctype_workaround.h" +#endif + + +namespace tut +{ + test_runner_singleton runner; +} + +class LLTestCallback : public tut::callback +{ +public: + LLTestCallback(bool verbose_mode) : + mVerboseMode(verbose_mode), + mTotalTests(0), + mPassedTests(0), + mFailedTests(0) + { + } + + void run_started() + { + //std::cout << "run_started" << std::endl; + } + + void test_completed(const tut::test_result& tr) + { + ++mTotalTests; + std::ostringstream out; + out << "[" << tr.group << ", " << tr.test << "] "; + switch(tr.result) + { + case tut::test_result::ok: + ++mPassedTests; + out << "ok"; + break; + case tut::test_result::fail: + ++mFailedTests; + out << "fail '" << tr.message << "'"; + break; + case tut::test_result::ex: + ++mFailedTests; + out << "exception"; + break; + case tut::test_result::warn: + ++mFailedTests; + out << "test destructor throw"; + break; + case tut::test_result::term: + ++mFailedTests; + out << "abnormal termination"; + break; + default: + ++mFailedTests; + out << "unknown"; + } + if(mVerboseMode || (tr.result != tut::test_result::ok)) + { + std::cout << out.str() << std::endl; + } + } + + void run_completed() + { + std::cout << std::endl; + std::cout << "Total Tests: " << mTotalTests << std::endl; + std::cout << "Passed Tests : " << mPassedTests << std::endl; + if(mFailedTests > 0) + { + std::cout << "*********************************" << std::endl; + std::cout << "Failed Tests: " << mFailedTests << std::endl; + std::cout << "Please report or fix the problem." << std::endl; + std::cout << "*********************************" << std::endl; + exit(1); + } + } + +protected: + bool mVerboseMode; + S32 mTotalTests; + S32 mPassedTests; + S32 mFailedTests; +}; + +static const apr_getopt_option_t TEST_CL_OPTIONS[] = +{ + {"help", 'h', 0, "Print the help message."}, + {"list", 'l', 0, "List available test groups."}, + {"verbose", 'v', 0, "Verbose output."}, + {"group", 'g', 1, "Run test group specified by option argument."}, + {"wait", 'w', 0, "Wait for input before exit."}, + {0, 0, 0, 0} +}; + +void stream_usage(std::ostream& s, const char* app) +{ + s << "Usage: " << app << " [OPTIONS]" << std::endl + << std::endl; + + s << "This application runs the unit tests." << std::endl << std::endl; + + s << "Options: " << std::endl; + const apr_getopt_option_t* option = &TEST_CL_OPTIONS[0]; + while(option->name) + { + s << " "; + s << " -" << (char)option->optch << ", --" << option->name + << std::endl; + s << "\t" << option->description << std::endl << std::endl; + ++option; + } + + s << "Examples:" << std::endl; + s << " " << app << " --verbose" << std::endl; + s << "\tRun all the tests and report all results." << std::endl; + s << " " << app << " --list" << std::endl; + s << "\tList all available test groups." << std::endl; + s << " " << app << " --group=uuid" << std::endl; + s << "\tRun the test group 'uuid'." << std::endl; +} + +void stream_groups(std::ostream& s, const char* app) +{ + s << "Registered test groups:" << std::endl; + tut::groupnames gl = tut::runner.get().list_groups(); + tut::groupnames::const_iterator it = gl.begin(); + tut::groupnames::const_iterator end = gl.end(); + for(; it != end; ++it) + { + s << " " << *(it) << std::endl; + } +} + +int main(int argc, char **argv) +{ +#ifdef CTYPE_WORKAROUND + ctype_workaround(); +#endif + + apr_initialize(); + apr_pool_t* pool = NULL; + if(APR_SUCCESS != apr_pool_create(&pool, NULL)) + { + std::cerr << "Unable to initialize pool" << std::endl; + return 1; + } + apr_getopt_t* os = NULL; + if(APR_SUCCESS != apr_getopt_init(&os, pool, argc, argv)) + { + std::cerr << "Unable to pool" << std::endl; + return 1; + } + + // values used for controlling application + bool verbose_mode = false; + bool wait_at_exit = false; + std::string test_group; + + // values use for options parsing + apr_status_t apr_err; + const char* opt_arg = NULL; + int opt_id = 0; + while(true) + { + apr_err = apr_getopt_long(os, TEST_CL_OPTIONS, &opt_id, &opt_arg); + if(APR_STATUS_IS_EOF(apr_err)) break; + if(apr_err) + { + char buf[255]; + std::cerr << "Error parsing options: " + << apr_strerror(apr_err, buf, 255) << std::endl; + return 1; + } + switch (opt_id) + { + case 'g': + test_group.assign(opt_arg); + break; + case 'h': + stream_usage(std::cout, argv[0]); + return 0; + break; + case 'l': + stream_groups(std::cout, argv[0]); + return 0; + case 'v': + verbose_mode = true; + break; + case 'w': + wait_at_exit = true; + break; + default: + stream_usage(std::cerr, argv[0]); + return 1; + break; + } + } + + // run the tests + LLTestCallback callback(verbose_mode); + tut::runner.get().set_callback(&callback); + + if(test_group.empty()) + { + tut::runner.get().run_tests(); + } + else + { + tut::runner.get().run_tests(test_group); + } + + if (wait_at_exit) + { + std::cerr << "Waiting for input before exiting..." << std::endl; + std::cin.get(); + } + + apr_terminate(); + return 0; +} 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.1