MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / check_csv_cursor_table

Function check_csv_cursor_table

test/csv/src/csv_cursor_tests.cpp:994–1026  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

992
993template <typename CursorType>
994void check_csv_cursor_table(std::string info, CursorType& cursor,
995 std::string expected_key, unsigned expected_value)
996{
997 INFO(info);
998
999 REQUIRE_FALSE(cursor.done());
1000 REQUIRE(staj_events::begin_array == cursor.current().event_type());
1001
1002 CHECK_FALSE(cursor.done());
1003 cursor.next();
1004 REQUIRE(staj_events::begin_object == cursor.current().event_type());
1005
1006 CHECK_FALSE(cursor.done());
1007 cursor.next();
1008 REQUIRE(staj_events::key == cursor.current().event_type());
1009 CHECK(cursor.current().template get<std::string>() == expected_key);
1010
1011 CHECK_FALSE(cursor.done());
1012 cursor.next();
1013 REQUIRE(staj_events::uint64_value == cursor.current().event_type());
1014 CHECK(cursor.current().template get<unsigned>() == expected_value);
1015
1016 CHECK_FALSE(cursor.done());
1017 cursor.next();
1018 REQUIRE(staj_events::end_object == cursor.current().event_type());
1019
1020 CHECK_FALSE(cursor.done());
1021 cursor.next();
1022 REQUIRE(staj_events::end_array == cursor.current().event_type());
1023
1024 cursor.next();
1025 CHECK(cursor.done());
1026}
1027
1028TEMPLATE_TEST_CASE("csv_cursor reset test", "",
1029 (std::pair<csv::csv_string_cursor, std::string>),

Callers 1

Calls 4

event_typeMethod · 0.80
currentMethod · 0.80
doneMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected