MCPcopy Create free account
hub / github.com/boostorg/json / testSetNonThrowing

Method testSetNonThrowing

test/pointer.cpp:318–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316
317 template<class ErrorCode>
318 void
319 testSetNonThrowing()
320 {
321 ErrorCode ec;
322
323 value* result;
324 value jv;
325
326 result = jv.set_at_pointer( "", array(), ec );
327 BOOST_TEST( result );
328 BOOST_TEST( !ec );
329
330 result = jv.set_at_pointer( "/1", 0, ec );
331 BOOST_TEST( !result );
332 BOOST_TEST( ec == error::not_found );
333 BOOST_TEST( hasLocation(ec) );
334
335 result = jv.set_at_pointer( "/x", 0, ec );
336 BOOST_TEST( !result );
337 BOOST_TEST( ec == error::token_not_number );
338 BOOST_TEST( hasLocation(ec) );
339
340 result = jv.set_at_pointer( "/-", "", ec );
341 BOOST_TEST( result );
342 BOOST_TEST( !ec );
343
344 result = jv.set_at_pointer( "/0/x", 1, ec );
345 BOOST_TEST( ec == error::value_is_scalar );
346 BOOST_TEST( hasLocation(ec) );
347 }
348
349 void
350 testTry()

Callers

nothing calls this directly

Calls 1

arrayClass · 0.50

Tested by

no test coverage detected