| 992 | |
| 993 | template <typename CursorType> |
| 994 | void 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 | |
| 1028 | TEMPLATE_TEST_CASE("csv_cursor reset test", "", |
| 1029 | (std::pair<csv::csv_string_cursor, std::string>), |
no test coverage detected