diff options
author | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
commit | 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch) | |
tree | bcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/test/io.cpp | |
parent | Second Life viewer sources 1.13.3.2 (diff) | |
download | meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2 meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz |
Second Life viewer sources 1.14.0.0
Diffstat (limited to 'linden/indra/test/io.cpp')
-rw-r--r-- | linden/indra/test/io.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/linden/indra/test/io.cpp b/linden/indra/test/io.cpp index 2f6ba09..a86711a 100644 --- a/linden/indra/test/io.cpp +++ b/linden/indra/test/io.cpp | |||
@@ -77,7 +77,7 @@ namespace tut | |||
77 | void buffer_object::test<2>() | 77 | void buffer_object::test<2>() |
78 | { | 78 | { |
79 | const char HELLO_WORLD[] = "hello world"; | 79 | const char HELLO_WORLD[] = "hello world"; |
80 | const S32 str_len = strlen(HELLO_WORLD); | 80 | const S32 str_len = strlen(HELLO_WORLD); /* Flawfinder: ignore */ |
81 | LLChannelDescriptors ch = mBuffer.nextChannel(); | 81 | LLChannelDescriptors ch = mBuffer.nextChannel(); |
82 | mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len); | 82 | mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len); |
83 | mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len); | 83 | mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len); |
@@ -99,7 +99,7 @@ namespace tut | |||
99 | LLChannelDescriptors ch = mBuffer.nextChannel(); | 99 | LLChannelDescriptors ch = mBuffer.nextChannel(); |
100 | mBuffer.append(ch.in(), (U8*)ONE, 3); | 100 | mBuffer.append(ch.in(), (U8*)ONE, 3); |
101 | mBuffer.append(ch.in(), (U8*)TWO, 3); | 101 | mBuffer.append(ch.in(), (U8*)TWO, 3); |
102 | char buffer[255]; | 102 | char buffer[255]; /* Flawfinder: ignore */ |
103 | S32 len = 6; | 103 | S32 len = 6; |
104 | mBuffer.readAfter(ch.in(), NULL, (U8*)buffer, len); | 104 | mBuffer.readAfter(ch.in(), NULL, (U8*)buffer, len); |
105 | ensure_equals(len, 6); | 105 | ensure_equals(len, 6); |
@@ -118,7 +118,7 @@ namespace tut | |||
118 | LLChannelDescriptors ch = mBuffer.nextChannel(); | 118 | LLChannelDescriptors ch = mBuffer.nextChannel(); |
119 | mBuffer.append(ch.in(), (U8*)TWO, 3); | 119 | mBuffer.append(ch.in(), (U8*)TWO, 3); |
120 | mBuffer.prepend(ch.in(), (U8*)ONE, 3); | 120 | mBuffer.prepend(ch.in(), (U8*)ONE, 3); |
121 | char buffer[255]; | 121 | char buffer[255]; /* Flawfinder: ignore */ |
122 | S32 len = 6; | 122 | S32 len = 6; |
123 | mBuffer.readAfter(ch.in(), NULL, (U8*)buffer, len); | 123 | mBuffer.readAfter(ch.in(), NULL, (U8*)buffer, len); |
124 | ensure_equals(len, 6); | 124 | ensure_equals(len, 6); |
@@ -136,7 +136,7 @@ namespace tut | |||
136 | LLChannelDescriptors ch = mBuffer.nextChannel(); | 136 | LLChannelDescriptors ch = mBuffer.nextChannel(); |
137 | mBuffer.append(ch.in(), (U8*)TWO, 3); | 137 | mBuffer.append(ch.in(), (U8*)TWO, 3); |
138 | mBuffer.prepend(ch.in(), (U8*)ONE, 3); | 138 | mBuffer.prepend(ch.in(), (U8*)ONE, 3); |
139 | char buffer[255]; | 139 | char buffer[255]; /* Flawfinder: ignore */ |
140 | S32 len = 5; | 140 | S32 len = 5; |
141 | LLBufferArray::segment_iterator_t it = mBuffer.beginSegment(); | 141 | LLBufferArray::segment_iterator_t it = mBuffer.beginSegment(); |
142 | U8* addr = (*it).data(); | 142 | U8* addr = (*it).data(); |
@@ -163,7 +163,7 @@ namespace tut | |||
163 | header << "ContentLength: " << count << "\r\n\r\n"; | 163 | header << "ContentLength: " << count << "\r\n\r\n"; |
164 | std::string head(header.str()); | 164 | std::string head(header.str()); |
165 | mBuffer.prepend(ch.out(), (U8*)head.c_str(), head.length()); | 165 | mBuffer.prepend(ch.out(), (U8*)head.c_str(), head.length()); |
166 | char buffer[1024]; | 166 | char buffer[1024]; /* Flawfinder: ignore */ |
167 | S32 len = response.size() + head.length(); | 167 | S32 len = response.size() + head.length(); |
168 | ensure_equals("same length", len, (S32)expected.str().length()); | 168 | ensure_equals("same length", len, (S32)expected.str().length()); |
169 | mBuffer.readAfter(ch.out(), NULL, (U8*)buffer, len); | 169 | mBuffer.readAfter(ch.out(), NULL, (U8*)buffer, len); |
@@ -228,11 +228,11 @@ namespace tut | |||
228 | delete[] temp; | 228 | delete[] temp; |
229 | } | 229 | } |
230 | 230 | ||
231 | /* | 231 | #if 0 |
232 | template<> template<> | 232 | template<> template<> |
233 | void buffer_object::test<9>() | 233 | void buffer_object::test<9>() |
234 | { | 234 | { |
235 | char buffer[1024]; | 235 | char buffer[1024]; /* Flawfinder: ignore */ |
236 | S32 size = sprintf(buffer, | 236 | S32 size = sprintf(buffer, |
237 | "%d|%d|%s|%s|%s|%s|%s|%x|%x|%x|%x|%x|%s|%s|%d|%d|%x", | 237 | "%d|%d|%s|%s|%s|%s|%s|%x|%x|%x|%x|%x|%s|%s|%d|%d|%x", |
238 | 7, | 238 | 7, |
@@ -263,7 +263,7 @@ namespace tut | |||
263 | ensure_equals("Buffer sizes",size,(S32)post_size); | 263 | ensure_equals("Buffer sizes",size,(S32)post_size); |
264 | ensure("Buffer content",!strcmp(buffer,post_buffer)); | 264 | ensure("Buffer content",!strcmp(buffer,post_buffer)); |
265 | } | 265 | } |
266 | */ | 266 | #endif |
267 | 267 | ||
268 | /* | 268 | /* |
269 | template<> template<> | 269 | template<> template<> |
@@ -287,7 +287,7 @@ namespace tut | |||
287 | void bas_object::test<1>() | 287 | void bas_object::test<1>() |
288 | { | 288 | { |
289 | const char HELLO_WORLD[] = "hello world"; | 289 | const char HELLO_WORLD[] = "hello world"; |
290 | const S32 str_len = strlen(HELLO_WORLD); | 290 | const S32 str_len = strlen(HELLO_WORLD); /* Flawfinder: ignore */ |
291 | LLChannelDescriptors ch = mBuffer.nextChannel(); | 291 | LLChannelDescriptors ch = mBuffer.nextChannel(); |
292 | LLBufferStream str(ch, &mBuffer); | 292 | LLBufferStream str(ch, &mBuffer); |
293 | mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len); | 293 | mBuffer.append(ch.in(), (U8*)HELLO_WORLD, str_len); |
@@ -425,7 +425,7 @@ namespace tut | |||
425 | ostr << ") "; | 425 | ostr << ") "; |
426 | bstr.flush(); | 426 | bstr.flush(); |
427 | const S32 BUF_LEN = 512; | 427 | const S32 BUF_LEN = 512; |
428 | char buf[BUF_LEN]; | 428 | char buf[BUF_LEN]; /* Flawfinder: ignore */ |
429 | S32 actual_len = BUF_LEN; | 429 | S32 actual_len = BUF_LEN; |
430 | (void) mBuffer.readAfter(ch.out(), NULL, (U8*)buf, actual_len); | 430 | (void) mBuffer.readAfter(ch.out(), NULL, (U8*)buf, actual_len); |
431 | buf[actual_len] = '\0'; | 431 | buf[actual_len] = '\0'; |
@@ -479,7 +479,7 @@ namespace tut | |||
479 | ++total_size; | 479 | ++total_size; |
480 | } | 480 | } |
481 | need_comma = true; | 481 | need_comma = true; |
482 | srand(69 + i); | 482 | srand(69 + i); /* Flawfinder: ignore */ |
483 | S32 size = rand() % 1000 + 1000; | 483 | S32 size = rand() % 1000 + 1000; |
484 | std::generate_n( | 484 | std::generate_n( |
485 | std::back_insert_iterator<buf_t>(source), | 485 | std::back_insert_iterator<buf_t>(source), |
@@ -545,7 +545,7 @@ namespace tut | |||
545 | need_comma = true; | 545 | need_comma = true; |
546 | ostr << "'" << i << "':"; | 546 | ostr << "'" << i << "':"; |
547 | total_size += 7; | 547 | total_size += 7; |
548 | srand(69 + i); | 548 | srand(69 + i); /* Flawfinder: ignore */ |
549 | S32 size = rand() % 1000 + 1000; | 549 | S32 size = rand() % 1000 + 1000; |
550 | std::generate_n( | 550 | std::generate_n( |
551 | std::back_insert_iterator<buf_t>(source), | 551 | std::back_insert_iterator<buf_t>(source), |
@@ -601,7 +601,7 @@ namespace tut | |||
601 | "'circuit_code': i124,'group_id': '8615c885-9cf0-bf0a-6e40-0c11462aa652','limited_to_estate': i1,'look_at': [ i0, i0, i0]," | 601 | "'circuit_code': i124,'group_id': '8615c885-9cf0-bf0a-6e40-0c11462aa652','limited_to_estate': i1,'look_at': [ i0, i0, i0]," |
602 | "'agent_id': '0e346d8b-4433-4d66-a6b0-fd37083abc4c','first_name': 'Kelly','start': 'url'}]}"; | 602 | "'agent_id': '0e346d8b-4433-4d66-a6b0-fd37083abc4c','first_name': 'Kelly','start': 'url'}]}"; |
603 | LLChannelDescriptors ch = mBuffer.nextChannel(); | 603 | LLChannelDescriptors ch = mBuffer.nextChannel(); |
604 | mBuffer.append(ch.out(), (U8*)LOGIN_STREAM, strlen(LOGIN_STREAM)); | 604 | mBuffer.append(ch.out(), (U8*)LOGIN_STREAM, strlen(LOGIN_STREAM)); /* Flawfinder: ignore */ |
605 | ch = mBuffer.nextChannel(); | 605 | ch = mBuffer.nextChannel(); |
606 | LLBufferStream istr(ch, &mBuffer); | 606 | LLBufferStream istr(ch, &mBuffer); |
607 | LLSD data; | 607 | LLSD data; |
@@ -1119,7 +1119,7 @@ namespace tut | |||
1119 | stream << "{'task_id':ucc706f2d-0b68-68f8-11a4-f1043ff35ca0}\n{\n\tname\tObject|\n\tpermissions 0\n}"; | 1119 | stream << "{'task_id':ucc706f2d-0b68-68f8-11a4-f1043ff35ca0}\n{\n\tname\tObject|\n\tpermissions 0\n}"; |
1120 | std::vector<U8> expected_binary; | 1120 | std::vector<U8> expected_binary; |
1121 | expected_binary.resize(stream.str().size()); | 1121 | expected_binary.resize(stream.str().size()); |
1122 | memcpy(&expected_binary[0], stream.str().c_str(), stream.str().size()); | 1122 | memcpy(&expected_binary[0], stream.str().c_str(), stream.str().size()); /* Flawfinder: ignore */ |
1123 | stream.str(""); | 1123 | stream.str(""); |
1124 | stream << "[{'uri':'" << uri << "'}, {'version':i1}, " | 1124 | stream << "[{'uri':'" << uri << "'}, {'version':i1}, " |
1125 | << "{'agent_id':'3c115e51-04f4-523c-9fa6-98aff1034730', 'session_id':'2c585cec-038c-40b0-b42e-a25ebab4d132', 'circuit_code':i1075, 'start':'region', 'limited_to_estate':i1 'first_name':'Phoenix', 'last_name':'Linden', 'group_title':'', 'group_id':u00000000-0000-0000-0000-000000000000, 'position':[r70.9247,r254.378,r38.7304], 'look_at':[r-0.043753,r-0.999042,r0], 'granters':[ua2e76fcd-9360-4f6d-a924-000000000003], 'texture_data':['5e481e8a-58a6-fc34-6e61-c7a36095c07f', 'c39675f5-ca90-a304-bb31-42cdb803a132', '5c989edf-88d1-b2ac-b00b-5ed4bab8e368', '6522e74d-1660-4e7f-b601-6f48c1659a77', '7ca39b4c-bd19-4699-aff7-f93fd03d3e7b', '41c58177-5eb6-5aeb-029d-bc4093f3c130', '97b75473-8b93-9b25-2a11-035b9ae93195', '1c2d8d9b-90eb-89d4-dea8-c1ed83990614', '69ec543f-e27b-c07c-9094-a8be6300f274', 'c9f8b80f-c629-4633-04ee-c566ce9fea4b', '989cddba-7ab6-01ed-67aa-74accd2a2a65', '45e319b2-6a8c-fa5c-895b-1a7149b88aef', '5748decc-f629-461c-9a36-a35a221fe21f', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', '685fbe10-ab40-f065-0aec-726cc6dfd7a1', '406f98fd-9c89-1d52-5f39-e67d508c5ee5', '685fbe10-ab40-f065-0aec-726cc6dfd7a1', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97'], " | 1125 | << "{'agent_id':'3c115e51-04f4-523c-9fa6-98aff1034730', 'session_id':'2c585cec-038c-40b0-b42e-a25ebab4d132', 'circuit_code':i1075, 'start':'region', 'limited_to_estate':i1 'first_name':'Phoenix', 'last_name':'Linden', 'group_title':'', 'group_id':u00000000-0000-0000-0000-000000000000, 'position':[r70.9247,r254.378,r38.7304], 'look_at':[r-0.043753,r-0.999042,r0], 'granters':[ua2e76fcd-9360-4f6d-a924-000000000003], 'texture_data':['5e481e8a-58a6-fc34-6e61-c7a36095c07f', 'c39675f5-ca90-a304-bb31-42cdb803a132', '5c989edf-88d1-b2ac-b00b-5ed4bab8e368', '6522e74d-1660-4e7f-b601-6f48c1659a77', '7ca39b4c-bd19-4699-aff7-f93fd03d3e7b', '41c58177-5eb6-5aeb-029d-bc4093f3c130', '97b75473-8b93-9b25-2a11-035b9ae93195', '1c2d8d9b-90eb-89d4-dea8-c1ed83990614', '69ec543f-e27b-c07c-9094-a8be6300f274', 'c9f8b80f-c629-4633-04ee-c566ce9fea4b', '989cddba-7ab6-01ed-67aa-74accd2a2a65', '45e319b2-6a8c-fa5c-895b-1a7149b88aef', '5748decc-f629-461c-9a36-a35a221fe21f', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', '685fbe10-ab40-f065-0aec-726cc6dfd7a1', '406f98fd-9c89-1d52-5f39-e67d508c5ee5', '685fbe10-ab40-f065-0aec-726cc6dfd7a1', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97', 'c228d1cf-4b5d-4ba8-84f4-899a0796aa97'], " |
@@ -1213,7 +1213,7 @@ namespace tut | |||
1213 | tmp_str << "{'task_id':ucc706f2d-0b68-68f8-11a4-f1043ff35ca0}\n{\n\tname\tObject|\n\tpermissions 0\n}"; | 1213 | tmp_str << "{'task_id':ucc706f2d-0b68-68f8-11a4-f1043ff35ca0}\n{\n\tname\tObject|\n\tpermissions 0\n}"; |
1214 | std::vector<U8> expected_binary; | 1214 | std::vector<U8> expected_binary; |
1215 | expected_binary.resize(tmp_str.str().size()); | 1215 | expected_binary.resize(tmp_str.str().size()); |
1216 | memcpy( | 1216 | memcpy( /* Flawfinder: ignore */ |
1217 | &expected_binary[0], | 1217 | &expected_binary[0], |
1218 | tmp_str.str().c_str(), | 1218 | tmp_str.str().c_str(), |
1219 | tmp_str.str().size()); | 1219 | tmp_str.str().size()); |