diff options
Diffstat (limited to 'linden/indra/test')
-rw-r--r-- | linden/indra/test/files.lst | 1 | ||||
-rw-r--r-- | linden/indra/test/llbuffer_tut.cpp | 2 | ||||
-rw-r--r-- | linden/indra/test/llhttpdate_tut.cpp | 92 | ||||
-rw-r--r-- | linden/indra/test/llmessagetemplateparser_tut.cpp | 1 | ||||
-rw-r--r-- | linden/indra/test/llpermissions_tut.cpp | 1 | ||||
-rwxr-xr-x | linden/indra/test/llsdmessagereader_tut.cpp | 1 | ||||
-rw-r--r-- | linden/indra/test/llservicebuilder_tut.cpp | 17 | ||||
-rw-r--r-- | linden/indra/test/lltemplatemessagebuilder_tut.cpp | 1 | ||||
-rw-r--r-- | linden/indra/test/lluri_tut.cpp | 12 | ||||
-rw-r--r-- | linden/indra/test/message_tut.cpp | 1 | ||||
-rw-r--r-- | linden/indra/test/test_llmanifest.py | 2 |
11 files changed, 124 insertions, 7 deletions
diff --git a/linden/indra/test/files.lst b/linden/indra/test/files.lst index 8063bfd..d923d8f 100644 --- a/linden/indra/test/files.lst +++ b/linden/indra/test/files.lst | |||
@@ -8,6 +8,7 @@ test/llbuffer_tut.cpp | |||
8 | test/lldate_tut.cpp | 8 | test/lldate_tut.cpp |
9 | test/llerror_tut.cpp | 9 | test/llerror_tut.cpp |
10 | test/llhost_tut.cpp | 10 | test/llhost_tut.cpp |
11 | test/llhttpdate_tut.cpp | ||
11 | test/llhttpclient_tut.cpp | 12 | test/llhttpclient_tut.cpp |
12 | test/llhttpnode_tut.cpp | 13 | test/llhttpnode_tut.cpp |
13 | test/llinventoryparcel_tut.cpp | 14 | test/llinventoryparcel_tut.cpp |
diff --git a/linden/indra/test/llbuffer_tut.cpp b/linden/indra/test/llbuffer_tut.cpp index bf58abb..afe3133 100644 --- a/linden/indra/test/llbuffer_tut.cpp +++ b/linden/indra/test/llbuffer_tut.cpp | |||
@@ -31,8 +31,10 @@ | |||
31 | #include <tut/tut.h> | 31 | #include <tut/tut.h> |
32 | #include "lltut.h" | 32 | #include "lltut.h" |
33 | #include "llbuffer.h" | 33 | #include "llbuffer.h" |
34 | #include "llerror.h" | ||
34 | #include "llmemtype.h" | 35 | #include "llmemtype.h" |
35 | 36 | ||
37 | |||
36 | namespace tut | 38 | namespace tut |
37 | { | 39 | { |
38 | struct buffer | 40 | struct buffer |
diff --git a/linden/indra/test/llhttpdate_tut.cpp b/linden/indra/test/llhttpdate_tut.cpp new file mode 100644 index 0000000..5279a81 --- /dev/null +++ b/linden/indra/test/llhttpdate_tut.cpp | |||
@@ -0,0 +1,92 @@ | |||
1 | /** | ||
2 | * @file llhttpdate_tut.cpp | ||
3 | * @author Kartic Krishnamurthy | ||
4 | * @date Wednesday, 18 Jul 2007 17:00:00 GMT :) | ||
5 | * | ||
6 | * Copyright (c) 2007-2007, Linden Research, Inc. | ||
7 | * | ||
8 | * Second Life Viewer Source Code | ||
9 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
10 | * to you under the terms of the GNU General Public License, version 2.0 | ||
11 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
12 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
13 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
14 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
15 | * | ||
16 | * There are special exceptions to the terms and conditions of the GPL as | ||
17 | * it is applied to this Source Code. View the full text of the exception | ||
18 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
19 | * online at http://secondlife.com/developers/opensource/flossexception | ||
20 | * | ||
21 | * By copying, modifying or distributing this software, you acknowledge | ||
22 | * that you have read and understood your obligations described above, | ||
23 | * and agree to abide by those obligations. | ||
24 | * | ||
25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
27 | * COMPLETENESS OR PERFORMANCE. | ||
28 | */ | ||
29 | |||
30 | #include "linden_common.h" | ||
31 | #include "lltut.h" | ||
32 | |||
33 | #include "lldate.h" | ||
34 | #include "llframetimer.h" | ||
35 | |||
36 | #include <string> | ||
37 | #include <time.h> | ||
38 | |||
39 | namespace tut | ||
40 | { | ||
41 | struct httpdate_data | ||
42 | { | ||
43 | LLDate some_date; | ||
44 | }; | ||
45 | typedef test_group<httpdate_data> httpdate_test; | ||
46 | typedef httpdate_test::object httpdate_object; | ||
47 | tut::httpdate_test httpdate("httpdate"); | ||
48 | |||
49 | template<> template<> | ||
50 | void httpdate_object::test<1>() | ||
51 | { | ||
52 | static std::string epoch_expected = "Thursday, 01 Jan 1970 00:00:00 GMT" ; | ||
53 | ensure("Check Epoch in RFC 1123", ( epoch_expected == some_date.asRFC1123())); | ||
54 | } | ||
55 | |||
56 | template<> template<> | ||
57 | void httpdate_object::test<2>() | ||
58 | { | ||
59 | static std::string expected = "Wednesday, 18 Jul 2007 22:17:24 GMT" ; | ||
60 | some_date = LLDate(1184797044.037586); | ||
61 | ensure("Check some timestamp in RFC 1123", ( expected == some_date.asRFC1123())); | ||
62 | } | ||
63 | |||
64 | // This test of course most generic.. runs off current time | ||
65 | template<> template<> | ||
66 | void httpdate_object::test<3>() | ||
67 | { | ||
68 | //F64 sometime = LLFrameTimer::getTotalSeconds(); | ||
69 | time_t sometime; | ||
70 | time(&sometime); | ||
71 | some_date = LLDate((F64) sometime); | ||
72 | struct tm result; | ||
73 | char expected[255], *actual; | ||
74 | |||
75 | gmtime_r((time_t *)&sometime, &result); | ||
76 | /* | ||
77 | std::cout << " seconds: "<< result.tm_sec | ||
78 | << ", minutes: " << result.tm_min | ||
79 | << ", hours: " << result.tm_hour | ||
80 | << ", day of the month: " << result.tm_mday | ||
81 | << ", month: " << result.tm_mon | ||
82 | << ", year: " << result.tm_year | ||
83 | << ", day of the week: " << result.tm_wday | ||
84 | << ", day in the year: " << result.tm_yday | ||
85 | << ", DST: " << result.tm_isdst << std::endl; | ||
86 | */ | ||
87 | strftime(expected, 255, "%A, %d %h %Y %H:%M:%S GMT", &result); | ||
88 | actual = (char *) some_date.asRFC1123().c_str(); | ||
89 | // probably not a good idea to use strcmp but this is just a unit test | ||
90 | ensure("Current time in RFC 1123", (strcmp(expected, actual) == 0)); | ||
91 | } | ||
92 | } | ||
diff --git a/linden/indra/test/llmessagetemplateparser_tut.cpp b/linden/indra/test/llmessagetemplateparser_tut.cpp index 74b4c55..7e1f5a3 100644 --- a/linden/indra/test/llmessagetemplateparser_tut.cpp +++ b/linden/indra/test/llmessagetemplateparser_tut.cpp | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | #include <tut/tut.h> | 30 | #include <tut/tut.h> |
31 | #include "lltut.h" | 31 | #include "lltut.h" |
32 | #include "linden_common.h" | ||
32 | #include "llmessagetemplateparser.h" | 33 | #include "llmessagetemplateparser.h" |
33 | 34 | ||
34 | namespace tut | 35 | namespace tut |
diff --git a/linden/indra/test/llpermissions_tut.cpp b/linden/indra/test/llpermissions_tut.cpp index 0c9082b..3b2cee0 100644 --- a/linden/indra/test/llpermissions_tut.cpp +++ b/linden/indra/test/llpermissions_tut.cpp | |||
@@ -29,6 +29,7 @@ | |||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <tut/tut.h> | 31 | #include <tut/tut.h> |
32 | #include "linden_common.h" | ||
32 | #include "lltut.h" | 33 | #include "lltut.h" |
33 | #include "message.h" | 34 | #include "message.h" |
34 | #include "llpermissions.h" | 35 | #include "llpermissions.h" |
diff --git a/linden/indra/test/llsdmessagereader_tut.cpp b/linden/indra/test/llsdmessagereader_tut.cpp index 5b644d0..0dd8974 100755 --- a/linden/indra/test/llsdmessagereader_tut.cpp +++ b/linden/indra/test/llsdmessagereader_tut.cpp | |||
@@ -28,6 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <tut/tut.h> | 30 | #include <tut/tut.h> |
31 | #include "linden_common.h" | ||
31 | #include "lltut.h" | 32 | #include "lltut.h" |
32 | 33 | ||
33 | #include "message.h" | 34 | #include "message.h" |
diff --git a/linden/indra/test/llservicebuilder_tut.cpp b/linden/indra/test/llservicebuilder_tut.cpp index 762aa46..3b9d8b4 100644 --- a/linden/indra/test/llservicebuilder_tut.cpp +++ b/linden/indra/test/llservicebuilder_tut.cpp | |||
@@ -92,5 +92,22 @@ namespace tut | |||
92 | std::string test_url = mServiceBuilder.buildServiceURI("ServiceBuilderTest", data_map); | 92 | std::string test_url = mServiceBuilder.buildServiceURI("ServiceBuilderTest", data_map); |
93 | ensure_equals("Replacement URL Creation for Non-existant Service", test_url , "/agent/{$agent-id}/name"); | 93 | ensure_equals("Replacement URL Creation for Non-existant Service", test_url , "/agent/{$agent-id}/name"); |
94 | } | 94 | } |
95 | |||
96 | template<> template<> | ||
97 | void ServiceBuilderTestObject::test<5>() | ||
98 | { | ||
99 | LLSD test_block; | ||
100 | test_block["service-builder"] = "/proc/{$proc}{%params}"; | ||
101 | mServiceBuilder.createServiceDefinition("ServiceBuilderTest", test_block["service-builder"]); | ||
102 | LLSD data_map; | ||
103 | data_map["proc"] = "do/something/useful"; | ||
104 | data_map["params"]["estate_id"] = 1; | ||
105 | data_map["params"]["query"] = "public"; | ||
106 | std::string test_url = mServiceBuilder.buildServiceURI("ServiceBuilderTest", data_map); | ||
107 | ensure_equals( | ||
108 | "two part URL Creation", | ||
109 | test_url , | ||
110 | "/proc/do/something/useful?estate_id=1&query=public"); | ||
111 | } | ||
95 | } | 112 | } |
96 | 113 | ||
diff --git a/linden/indra/test/lltemplatemessagebuilder_tut.cpp b/linden/indra/test/lltemplatemessagebuilder_tut.cpp index d25e57e..5f58660 100644 --- a/linden/indra/test/lltemplatemessagebuilder_tut.cpp +++ b/linden/indra/test/lltemplatemessagebuilder_tut.cpp | |||
@@ -28,6 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <tut/tut.h> | 30 | #include <tut/tut.h> |
31 | #include "linden_common.h" | ||
31 | #include "lltut.h" | 32 | #include "lltut.h" |
32 | 33 | ||
33 | #include "llapr.h" | 34 | #include "llapr.h" |
diff --git a/linden/indra/test/lluri_tut.cpp b/linden/indra/test/lluri_tut.cpp index a08fe4e..b49f6dd 100644 --- a/linden/indra/test/lluri_tut.cpp +++ b/linden/indra/test/lluri_tut.cpp | |||
@@ -165,8 +165,8 @@ namespace tut | |||
165 | query["123"] = "12"; | 165 | query["123"] = "12"; |
166 | query["abcd"] = "abc"; | 166 | query["abcd"] = "abc"; |
167 | checkParts(LLURI::buildHTTP("host", path, query), | 167 | checkParts(LLURI::buildHTTP("host", path, query), |
168 | "http", "//host/x/123?123=12&abcd=abc&", | 168 | "http", "//host/x/123?123=12&abcd=abc", |
169 | "host", "/x/123", "123=12&abcd=abc&"); | 169 | "host", "/x/123", "123=12&abcd=abc"); |
170 | } | 170 | } |
171 | 171 | ||
172 | template<> template<> | 172 | template<> template<> |
@@ -191,8 +191,8 @@ namespace tut | |||
191 | query["123"] = "?&*#//"; | 191 | query["123"] = "?&*#//"; |
192 | query["**@&?//"] = "abc"; | 192 | query["**@&?//"] = "abc"; |
193 | checkParts(LLURI::buildHTTP("host", path, query), | 193 | checkParts(LLURI::buildHTTP("host", path, query), |
194 | "http", "//host/x/123?**@&?//=abc&123=?&*#//&", | 194 | "http", "//host/x/123?**@&?//=abc&123=?&*#//", |
195 | "host", "/x/123", "**@&?//=abc&123=?&*#//&"); | 195 | "host", "/x/123", "**@&?//=abc&123=?&*#//"); |
196 | } | 196 | } |
197 | 197 | ||
198 | template<> template<> | 198 | template<> template<> |
@@ -206,8 +206,8 @@ namespace tut | |||
206 | query["123"] = "12"; | 206 | query["123"] = "12"; |
207 | query["abcd"] = "abc"; | 207 | query["abcd"] = "abc"; |
208 | checkParts(LLURI::buildHTTP("hi123*33--}{:portstuffs", path, query), | 208 | checkParts(LLURI::buildHTTP("hi123*33--}{:portstuffs", path, query), |
209 | "http", "//hi123*33--}{:portstuffs/x/123?123=12&abcd=abc&", | 209 | "http", "//hi123*33--}{:portstuffs/x/123?123=12&abcd=abc", |
210 | "hi123*33--}{:portstuffs", "/x/123", "123=12&abcd=abc&"); | 210 | "hi123*33--}{:portstuffs", "/x/123", "123=12&abcd=abc"); |
211 | } | 211 | } |
212 | 212 | ||
213 | template<> template<> | 213 | template<> template<> |
diff --git a/linden/indra/test/message_tut.cpp b/linden/indra/test/message_tut.cpp index 366c2b4..3425315 100644 --- a/linden/indra/test/message_tut.cpp +++ b/linden/indra/test/message_tut.cpp | |||
@@ -28,6 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <tut/tut.h> | 30 | #include <tut/tut.h> |
31 | #include "linden_common.h" | ||
31 | #include "lltut.h" | 32 | #include "lltut.h" |
32 | 33 | ||
33 | #include "llapr.h" | 34 | #include "llapr.h" |
diff --git a/linden/indra/test/test_llmanifest.py b/linden/indra/test/test_llmanifest.py index f503cbe..8bfca24 100644 --- a/linden/indra/test/test_llmanifest.py +++ b/linden/indra/test/test_llmanifest.py | |||
@@ -26,7 +26,7 @@ | |||
26 | # WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 26 | # WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
27 | # COMPLETENESS OR PERFORMANCE. | 27 | # COMPLETENESS OR PERFORMANCE. |
28 | 28 | ||
29 | from indra import llmanifest | 29 | from indra.util import llmanifest |
30 | import os.path | 30 | import os.path |
31 | import os | 31 | import os |
32 | import unittest | 32 | import unittest |