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

Method testOptional

test/parse_into.cpp:482–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480 }
481
482 void testOptional()
483 {
484#ifndef BOOST_NO_CXX17_HDR_OPTIONAL
485 testParseInto< std::optional<int> >( std::nullopt );
486 testParseInto< std::optional<int> >( 1 );
487 testParseInto< std::optional<std::uint64_t> >( ULONG_MAX );
488 testParseInto< std::optional<bool> >( true );
489 testParseInto< std::optional<double> >( 33.77 );
490
491 testParseInto< std::optional<std::vector<std::nullptr_t>> >(
492 std::nullopt );
493 testParseInto< std::optional<std::vector<std::nullptr_t>> >(
494 std::vector<std::nullptr_t>{} );
495 testParseInto< std::optional<std::vector<std::nullptr_t>> >(
496 std::vector<std::nullptr_t>{nullptr, nullptr} );
497
498 testParseInto< std::optional<std::vector<std::string>> >(
499 std::vector<std::string>{"1", "2", "3"} );
500
501 testParseInto< std::optional< std::map<std::string, int> > >(
502 std::map<std::string, int>{ {"1", 1}, {"2", 2}, {"3", 3} } );
503
504 testParseInto< std::vector< std::optional<int> > >(
505 {1, 2, 3, std::nullopt, 5, std::nullopt, std::nullopt, 8});
506#endif
507 }
508
509 void testPath()
510 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected