diff --git a/tests/empty.cpp b/tests/empty.cpp index 4941f50..a970347 100644 --- a/tests/empty.cpp +++ b/tests/empty.cpp @@ -25,7 +25,7 @@ BOOST_AUTO_TEST_CASE(empty) BOOST_CHECK_THROW( empty2.fromBinary( &empty1, 42 ), std::runtime_error ); BOOST_CHECK_EQUAL( empty2.toJSON(), "{}" ); - BOOST_CHECK_THROW( empty2.fromJSON( "{}" ), std::runtime_error ); - BOOST_CHECK_THROW( empty2.fromJSON( "blubb" ), std::runtime_error ); + BOOST_CHECK( empty2.fromJSON( "{}" )); + BOOST_CHECK( empty2.fromJSON( "blubb" )); BOOST_CHECK_NO_THROW( std::cout << empty1 ); } diff --git a/zerobuf/Zerobuf.cpp b/zerobuf/Zerobuf.cpp index 637a28f..c5dcc8f 100644 --- a/zerobuf/Zerobuf.cpp +++ b/zerobuf/Zerobuf.cpp @@ -120,8 +120,7 @@ Data Zerobuf::_toBinary() const bool Zerobuf::_fromJSON( const std::string& string ) { if( !_allocator ) - throw std::runtime_error( - "Can't convert empty Zerobuf object from JSON" ); + return true; Json::Value json; Json::Reader reader;