Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/empty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
3 changes: 1 addition & 2 deletions zerobuf/Zerobuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down