summaryrefslogtreecommitdiff
path: root/indra/llcommon/tests/llsdserialize_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/tests/llsdserialize_test.cpp')
-rwxr-xr-xindra/llcommon/tests/llsdserialize_test.cpp41
1 files changed, 23 insertions, 18 deletions
diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp
index b5893135ea..6fbb9abfc0 100755
--- a/indra/llcommon/tests/llsdserialize_test.cpp
+++ b/indra/llcommon/tests/llsdserialize_test.cpp
@@ -46,9 +46,10 @@ typedef U32 uint32_t;
#include "boost/range.hpp"
#include "boost/foreach.hpp"
#include "boost/function.hpp"
-#include "boost/lambda/lambda.hpp"
-#include "boost/lambda/bind.hpp"
-namespace lambda = boost::lambda;
+#include "boost/bind.hpp"
+#include "boost/phoenix/bind/bind_function.hpp"
+#include "boost/phoenix/core/argument.hpp"
+using namespace boost::phoenix;
#include "../llsd.h"
#include "../llsdserialize.h"
@@ -1612,6 +1613,20 @@ namespace tut
"print 'Running on', sys.platform\n");
}
+ // helper for test<3>
+ static void writeLLSDArray(std::ostream& out, const LLSD& array)
+ {
+ BOOST_FOREACH(LLSD item, llsd::inArray(array))
+ {
+ LLSDSerialize::toNotation(item, out);
+ // It's important to separate with newlines because Python's llsd
+ // module doesn't support parsing from a file stream, only from a
+ // string, so we have to know how much of the file to read into a
+ // string.
+ out << '\n';
+ }
+ }
+
template<> template<>
void TestPythonCompatibleObject::test<3>()
{
@@ -1639,26 +1654,16 @@ namespace tut
" assert False, 'Too many data items'\n";
// Create an llsdXXXXXX file containing 'data' serialized to
- // notation. It's important to separate with newlines because Python's
- // llsd module doesn't support parsing from a file stream, only from a
- // string, so we have to know how much of the file to read into a
- // string.
+ // notation.
NamedTempFile file("llsd",
// NamedTempFile's boost::function constructor
// takes a callable. To this callable it passes the
// std::ostream with which it's writing the
- // NamedTempFile. This lambda-based expression
- // first calls LLSD::Serialize() with that ostream,
- // then streams a newline to it, etc.
- (lambda::bind(LLSDSerialize::toNotation, cdata[0], lambda::_1),
- lambda::_1 << '\n',
- lambda::bind(LLSDSerialize::toNotation, cdata[1], lambda::_1),
- lambda::_1 << '\n',
- lambda::bind(LLSDSerialize::toNotation, cdata[2], lambda::_1),
- lambda::_1 << '\n'));
+ // NamedTempFile.
+ boost::bind(writeLLSDArray, _1, cdata));
python("read C++ notation",
- lambda::_1 <<
+ placeholders::arg1 <<
import_llsd <<
"def parse_each(iterable):\n"
" for item in iterable:\n"
@@ -1679,7 +1684,7 @@ namespace tut
NamedTempFile file("llsd", "");
python("write Python notation",
- lambda::_1 <<
+ placeholders::arg1 <<
"from __future__ import with_statement\n" <<
import_llsd <<
"DATA = [\n"