diff options
author | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
commit | cd17687f01420952712a500107e0f93e7ab8d5f8 (patch) | |
tree | ce48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/test/io.cpp | |
parent | Second Life viewer sources 1.19.0.5 (diff) | |
download | meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2 meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz |
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/test/io.cpp')
-rw-r--r-- | linden/indra/test/io.cpp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/linden/indra/test/io.cpp b/linden/indra/test/io.cpp index facf98d..fe8c19d 100644 --- a/linden/indra/test/io.cpp +++ b/linden/indra/test/io.cpp | |||
@@ -634,7 +634,7 @@ namespace tut | |||
634 | ensure_equals("size of buffer", count, total_size); | 634 | ensure_equals("size of buffer", count, total_size); |
635 | LLBufferStream istr(ch, &mBuffer); | 635 | LLBufferStream istr(ch, &mBuffer); |
636 | LLSD data; | 636 | LLSD data; |
637 | count = LLSDSerialize::fromNotation(data, istr); | 637 | count = LLSDSerialize::fromNotation(data, istr, total_size); |
638 | ensure("sd parsed", data.isDefined()); | 638 | ensure("sd parsed", data.isDefined()); |
639 | 639 | ||
640 | for(S32 j = 0; j < 3; ++j) | 640 | for(S32 j = 0; j < 3; ++j) |
@@ -699,7 +699,7 @@ namespace tut | |||
699 | ensure_equals("size of buffer", count, total_size); | 699 | ensure_equals("size of buffer", count, total_size); |
700 | LLBufferStream istr(ch, &mBuffer); | 700 | LLBufferStream istr(ch, &mBuffer); |
701 | LLSD data; | 701 | LLSD data; |
702 | count = LLSDSerialize::fromNotation(data, istr); | 702 | count = LLSDSerialize::fromNotation(data, istr, total_size); |
703 | ensure("sd parsed", data.isDefined()); | 703 | ensure("sd parsed", data.isDefined()); |
704 | } | 704 | } |
705 | 705 | ||
@@ -735,7 +735,10 @@ namespace tut | |||
735 | ch = mBuffer.nextChannel(); | 735 | ch = mBuffer.nextChannel(); |
736 | LLBufferStream istr(ch, &mBuffer); | 736 | LLBufferStream istr(ch, &mBuffer); |
737 | LLSD data; | 737 | LLSD data; |
738 | S32 count = LLSDSerialize::fromNotation(data, istr); | 738 | S32 count = LLSDSerialize::fromNotation( |
739 | data, | ||
740 | istr, | ||
741 | mBuffer.count(ch.in())); | ||
739 | ensure("parsed something", (count > 0)); | 742 | ensure("parsed something", (count > 0)); |
740 | ensure("sd parsed", data.isDefined()); | 743 | ensure("sd parsed", data.isDefined()); |
741 | ensure_equals("sd type", data.type(), LLSD::TypeMap); | 744 | ensure_equals("sd type", data.type(), LLSD::TypeMap); |
@@ -780,7 +783,7 @@ namespace tut | |||
780 | std::istringstream istr; | 783 | std::istringstream istr; |
781 | istr.str(val); | 784 | istr.str(val); |
782 | LLSD sd; | 785 | LLSD sd; |
783 | S32 count = LLSDSerialize::fromNotation(sd, istr); | 786 | S32 count = LLSDSerialize::fromNotation(sd, istr, val.size()); |
784 | ensure_equals("parser error return value", count, -1); | 787 | ensure_equals("parser error return value", count, -1); |
785 | ensure("data undefined", sd.isUndefined()); | 788 | ensure("data undefined", sd.isUndefined()); |
786 | } | 789 | } |
@@ -792,7 +795,7 @@ namespace tut | |||
792 | std::istringstream istr; | 795 | std::istringstream istr; |
793 | istr.str(val); | 796 | istr.str(val); |
794 | LLSD sd; | 797 | LLSD sd; |
795 | S32 count = LLSDSerialize::fromNotation(sd, istr); | 798 | S32 count = LLSDSerialize::fromNotation(sd, istr, val.size()); |
796 | ensure_equals("parser error return value", count, -1); | 799 | ensure_equals("parser error return value", count, -1); |
797 | ensure("data undefined", sd.isUndefined()); | 800 | ensure("data undefined", sd.isUndefined()); |
798 | } | 801 | } |
@@ -1324,7 +1327,10 @@ namespace tut | |||
1324 | << "}]"; | 1327 | << "}]"; |
1325 | 1328 | ||
1326 | LLSD request; | 1329 | LLSD request; |
1327 | S32 count = LLSDSerialize::fromNotation(request, stream); | 1330 | S32 count = LLSDSerialize::fromNotation( |
1331 | request, | ||
1332 | stream, | ||
1333 | stream.str().size()); | ||
1328 | ensure("parsed something", (count > 0)); | 1334 | ensure("parsed something", (count > 0)); |
1329 | 1335 | ||
1330 | pump_loop(request); | 1336 | pump_loop(request); |
@@ -1425,7 +1431,10 @@ namespace tut | |||
1425 | LLChannelDescriptors read_channel = buffer.nextChannel(); | 1431 | LLChannelDescriptors read_channel = buffer.nextChannel(); |
1426 | LLBufferStream read_stream(read_channel, &buffer); | 1432 | LLBufferStream read_stream(read_channel, &buffer); |
1427 | LLSD request; | 1433 | LLSD request; |
1428 | S32 count = LLSDSerialize::fromNotation(request, read_stream); | 1434 | S32 count = LLSDSerialize::fromNotation( |
1435 | request, | ||
1436 | read_stream, | ||
1437 | buffer.count(read_channel.in())); | ||
1429 | ensure("parsed something", (count > 0)); | 1438 | ensure("parsed something", (count > 0)); |
1430 | ensure("deserialized", request.isDefined()); | 1439 | ensure("deserialized", request.isDefined()); |
1431 | 1440 | ||
@@ -1487,7 +1496,10 @@ namespace tut | |||
1487 | str << "{'message':'" << LLSDNotationFormatter::escapeString(message) | 1496 | str << "{'message':'" << LLSDNotationFormatter::escapeString(message) |
1488 | << "'}"; | 1497 | << "'}"; |
1489 | LLSD request; | 1498 | LLSD request; |
1490 | S32 count = LLSDSerialize::fromNotation(request, str); | 1499 | S32 count = LLSDSerialize::fromNotation( |
1500 | request, | ||
1501 | str, | ||
1502 | str.str().size()); | ||
1491 | ensure_equals("parse count", count, 2); | 1503 | ensure_equals("parse count", count, 2); |
1492 | ensure_equals("request type", request.type(), LLSD::TypeMap); | 1504 | ensure_equals("request type", request.type(), LLSD::TypeMap); |
1493 | pump_loop(request); | 1505 | pump_loop(request); |
@@ -1510,7 +1522,7 @@ namespace tut | |||
1510 | std::istringstream istr; | 1522 | std::istringstream istr; |
1511 | istr.str(val); | 1523 | istr.str(val); |
1512 | LLSD sd; | 1524 | LLSD sd; |
1513 | LLSDSerialize::fromNotation(sd, istr); | 1525 | LLSDSerialize::fromNotation(sd, istr, val.size()); |
1514 | pump_loop(sd); | 1526 | pump_loop(sd); |
1515 | ensure("valid response", mResponse.isDefined()); | 1527 | ensure("valid response", mResponse.isDefined()); |
1516 | ensure_equals("parsed type", mResponse.type(), LLSD::TypeMap); | 1528 | ensure_equals("parsed type", mResponse.type(), LLSD::TypeMap); |