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

Method testDescribed

test/value_from.cpp:519–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517
518 template< class... Context >
519 static
520 void
521 testDescribed( Context const& ... ctx )
522 {
523 ignore_unused( ctx... );
524#ifdef BOOST_DESCRIBE_CXX14
525 ::value_from_test_ns::T10 t10{909, -1.45};
526 value jv = value_from( t10, ctx... );
527 BOOST_TEST(( jv == value{{"n", 909}, {"d", -1.45}} ));
528
529 ::value_from_test_ns::T11 t11;
530 t11.set_n(67);
531 t11.set_d(-.12);
532 t11.set_b(true);
533 t11.s = "qwerty";
534 jv = value_from( t11, ctx... );
535 BOOST_TEST(( jv == value{{"n", 67}, {"d", -.12}, {"s", "qwerty"}, {"b", true}} ));
536
537 ::value_from_test_ns::E1 e1 = ::value_from_test_ns::E1::a;
538 BOOST_TEST( value_from( e1, ctx... ) == "a" );
539
540 e1 = ::value_from_test_ns::E1::b;
541 BOOST_TEST( value_from( e1, ctx... ) == "b" );
542
543 e1 = static_cast<::value_from_test_ns::E1>(1001);
544 BOOST_TEST( value_from( e1, ctx... ) == 1001 );
545#endif
546 }
547
548 template< class... Context >
549 static

Callers

nothing calls this directly

Calls 4

value_fromFunction · 0.85
set_nMethod · 0.80
set_dMethod · 0.80
set_bMethod · 0.80

Tested by

no test coverage detected