diff --git a/generator/tests/helper.h b/generator/tests/helper.h index f70e65a..5ab2daa 100644 --- a/generator/tests/helper.h +++ b/generator/tests/helper.h @@ -34,7 +34,8 @@ inline void assertEqualityLinewise(const Iteratable &iteratable1, const Iteratab } } if (!differentLines.empty()) { - CPPUNIT_ASSERT_EQUAL_MESSAGE("the following lines differ: " + ConversionUtilities::joinStrings(differentLines, ", "), iteratable1, iteratable2); + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "the following lines differ: " + ConversionUtilities::joinStrings(differentLines, ", "), iteratable1, iteratable2); } } diff --git a/generator/tests/jsongenerator.cpp b/generator/tests/jsongenerator.cpp index 274a9f9..162d71b 100644 --- a/generator/tests/jsongenerator.cpp +++ b/generator/tests/jsongenerator.cpp @@ -1,5 +1,5 @@ -#include "./structs.h" #include "./helper.h" +#include "./structs.h" #include "../codefactory.h" @@ -126,8 +126,8 @@ void OverallTests::testSingleInheritence() "{\"someInt\":42,\"someString\":\"the answer\",\"yetAnotherString\":\"but what was the question\",\"someBool\":false}"); // test serialization - CPPUNIT_ASSERT_EQUAL(expectedJSONForBase, string(static_cast &>(test).toJson().GetString())); - CPPUNIT_ASSERT_EQUAL(expectedJSONForDerived, string(static_cast &>(test).toJson().GetString())); + CPPUNIT_ASSERT_EQUAL(expectedJSONForBase, string(as(test).toJson().GetString())); + CPPUNIT_ASSERT_EQUAL(expectedJSONForDerived, string(as(test).toJson().GetString())); // test deserialization const DerivedTestStruct parsedTest(JSONSerializable::fromJson(expectedJSONForDerived)); @@ -152,7 +152,7 @@ void OverallTests::testMultipleInheritence() "question\",\"arrayOfStrings\":[\"array\",\"of\",\"strings\"],\"someBool\":false}"); // test serialization - CPPUNIT_ASSERT_EQUAL(expectedJSONForDerived, string(static_cast &>(test).toJson().GetString())); + CPPUNIT_ASSERT_EQUAL(expectedJSONForDerived, string(as(test).toJson().GetString())); // test deserialization const MultipleDerivedTestStruct parsedTest(JSONSerializable::fromJson(expectedJSONForDerived)); diff --git a/lib/jsonreflector-boosthana.h b/lib/jsonreflector-boosthana.h index b107df2..190c4b0 100644 --- a/lib/jsonreflector-boosthana.h +++ b/lib/jsonreflector-boosthana.h @@ -23,7 +23,7 @@ template (boost::hana::first(pair)), value, allocator); + push(boost::hana::second(pair), boost::hana::to(boost::hana::first(pair)), value, allocator); }); } @@ -34,9 +34,8 @@ template , Traits::Not>>>...> void pull(Type &reflectable, RAPIDJSON_NAMESPACE::GenericValue>::ValueIterator &value) { - boost::hana::for_each(reflectable, [&value](auto pair) { - pull(boost::hana::second(pair), boost::hana::to(boost::hana::first(pair)), value); - }); + boost::hana::for_each( + reflectable, [&value](auto pair) { pull(boost::hana::second(pair), boost::hana::to(boost::hana::first(pair)), value); }); } template , Traits::Not>>>...> void pull(Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue>::ConstObject &value) { - boost::hana::for_each(reflectable, [&value](auto pair) { - pull(boost::hana::second(pair), boost::hana::to(boost::hana::first(pair)), value); - }); + boost::hana::for_each( + reflectable, [&value](auto pair) { pull(boost::hana::second(pair), boost::hana::to(boost::hana::first(pair)), value); }); } } // namespace Reflector diff --git a/lib/tests/jsonreflector-boosthana.cpp b/lib/tests/jsonreflector-boosthana.cpp index a9f3e2a..88297b2 100644 --- a/lib/tests/jsonreflector-boosthana.cpp +++ b/lib/tests/jsonreflector-boosthana.cpp @@ -31,27 +31,15 @@ using namespace ReflectiveRapidJSON; // define some structs for testing serialization struct TestObject : public JSONSerializable { - BOOST_HANA_DEFINE_STRUCT(TestObject, - (int, number), - (double, number2), - (vector, numbers), - (string, text), - (bool, boolean) - ); + BOOST_HANA_DEFINE_STRUCT(TestObject, (int, number), (double, number2), (vector, numbers), (string, text), (bool, boolean)); }; struct NestingObject : public JSONSerializable { - BOOST_HANA_DEFINE_STRUCT(NestingObject, - (string, name), - (TestObject, testObj) - ); + BOOST_HANA_DEFINE_STRUCT(NestingObject, (string, name), (TestObject, testObj)); }; struct NestingArray : public JSONSerializable { - BOOST_HANA_DEFINE_STRUCT(NestingArray, - (string, name), - (vector, testObjects) - ); + BOOST_HANA_DEFINE_STRUCT(NestingArray, (string, name), (vector, testObjects)); }; /// \endcond