From 567995aafbd27eb9978628b976eb6d8c878172cb Mon Sep 17 00:00:00 2001 From: ado Date: Mon, 10 Jul 2023 23:39:08 +0200 Subject: [PATCH] Remove deprecated code, add exception.hpp to single_header_generator.py script --- script/single_header_generator.py | 1 + test/test_converter.cpp | 9 --------- test/test_helpers.hpp | 2 -- test/test_splitter.cpp | 1 - 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/script/single_header_generator.py b/script/single_header_generator.py index 3916666..91c9dcc 100755 --- a/script/single_header_generator.py +++ b/script/single_header_generator.py @@ -2,6 +2,7 @@ headers_dir = 'include/ss/' headers = ['type_traits.hpp', + 'exception.hpp', 'function_traits.hpp', 'restrictions.hpp', 'common.hpp', diff --git a/test/test_converter.cpp b/test/test_converter.cpp index 6127f6b..a4e6f79 100644 --- a/test/test_converter.cpp +++ b/test/test_converter.cpp @@ -364,7 +364,6 @@ TEST_CASE("converter test ss:ax restriction (all except)") { } TEST_CASE("converter test ss:ax restriction (all except) with exceptions") { - // TODO remove ss::string_error ss::converter c; REQUIRE_EXCEPTION(c.convert>("0")); @@ -425,7 +424,6 @@ TEST_CASE("converter test ss:nx restriction (none except)") { } TEST_CASE("converter test ss:nx restriction (none except) with exceptions") { - // TODO remove ss::string_error ss::converter c; REQUIRE_EXCEPTION(c.convert>("3")); @@ -493,7 +491,6 @@ TEST_CASE("converter test ss:ir restriction (in range)") { } TEST_CASE("converter test ss:ir restriction (in range) with exceptions") { - // TODO remove ss::string_error ss::converter c; REQUIRE_EXCEPTION(c.convert>("3")); @@ -561,7 +558,6 @@ TEST_CASE("converter test ss:oor restriction (out of range)") { } TEST_CASE("converter test ss:oor restriction (out of range) with exceptions") { - // TODO remove ss::string_error ss::converter c; REQUIRE_EXCEPTION(c.convert>("3")); @@ -641,7 +637,6 @@ TEST_CASE("converter test ss:ne restriction (not empty)") { } TEST_CASE("converter test ss:ne restriction (not empty) with exceptions") { - // TODO remove ss::string_error ss::converter c; REQUIRE_EXCEPTION(c.convert>("")); @@ -733,7 +728,6 @@ TEST_CASE( TEST_CASE("converter test ss:lt ss::lte ss::gt ss::gte restriction (in range) " "with exception") { - // TODO remove ss::string_error ss::converter c; REQUIRE_EXCEPTION(c.convert>("3")); @@ -792,7 +786,6 @@ TEST_CASE("converter test error mode") { } TEST_CASE("converter test throw on error mode") { - // TODO remove ss::string_error ss::converter c; REQUIRE_EXCEPTION(c.convert("junk")); } @@ -846,7 +839,6 @@ TEST_CASE("converter test converter with quotes spacing and escaping") { TEST_CASE("converter test converter with quotes spacing and escaping with " "exceptions") { - // TODO remove ss::string_error on all below try { ss::converter c; @@ -957,7 +949,6 @@ TEST_CASE("converter test invalid split conversions") { } TEST_CASE("converter test invalid split conversions with exceptions") { - // TODO remove ss::string_error ss::converter, ss::trim<' '>, ss::quote<'"'>, ss::throw_on_error> c; diff --git a/test/test_helpers.hpp b/test/test_helpers.hpp index 8cab8bf..022076f 100644 --- a/test/test_helpers.hpp +++ b/test/test_helpers.hpp @@ -79,8 +79,6 @@ struct buffer { } #define CHECK_NOT_VARIANT(var, type) CHECK(!std::holds_alternative(var)); -// TODO remove -#include #define REQUIRE_EXCEPTION(...) \ try { \ diff --git a/test/test_splitter.cpp b/test/test_splitter.cpp index 87441a3..d6d4369 100644 --- a/test/test_splitter.cpp +++ b/test/test_splitter.cpp @@ -547,7 +547,6 @@ auto expect_unterminated_quote(Splitter& s, const std::string& line) { CHECK(s.unterminated_quote()); return vec; } catch (ss::exception& e) { - // TODO check if this is ok FAIL(std::string{e.what()}); return decltype(s.split(buff(line.c_str()))){}; }