mirror of
https://github.com/red0124/ssp.git
synced 2025-12-14 21:59:55 +01:00
Add null data buffer error handler and unit test, resolve TODOs
This commit is contained in:
@@ -21,6 +21,25 @@ TEST_CASE("test file not found") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("test null buffer") {
|
||||
{
|
||||
ss::parser p{nullptr, 10, ","};
|
||||
CHECK_FALSE(p.valid());
|
||||
}
|
||||
|
||||
{
|
||||
ss::parser<ss::string_error> p{nullptr, 10, ","};
|
||||
CHECK_FALSE(p.valid());
|
||||
}
|
||||
|
||||
try {
|
||||
ss::parser<ss::throw_on_error> p{nullptr, 10, ","};
|
||||
FAIL("Expected exception...");
|
||||
} catch (const std::exception& e) {
|
||||
CHECK_FALSE(std::string{e.what()}.empty());
|
||||
}
|
||||
}
|
||||
|
||||
template <bool buffer_mode, typename... Ts>
|
||||
void test_various_cases() {
|
||||
unique_file_name f{"test_parser"};
|
||||
|
||||
Reference in New Issue
Block a user