More sanitizers, fixes several errors caught by these.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-03-23 10:53:02 +01:00
parent 6005850115
commit afd51a7924
6 changed files with 42 additions and 12 deletions

View File

@@ -64,12 +64,11 @@ TEST_CASE("Test IndexOf") {
CHECK(ls.IndexOf(5) == 0);
CHECK(ls.IndexOf(1500) == 2);
CHECK(ls.IndexOf(300) == 5);
CHECK(ls.IndexOf(684) == -1);
CHECK_FALSE(ls.IndexOf(684).has_value());
}
TEST_CASE("Test list out of bounds") {
auto ls = List<int>({5, 200, 1500, -500, 5, 300, -500});
REQUIRE_THROWS(ls.At(-1));
REQUIRE_THROWS(ls.At(7));
}

View File

@@ -47,7 +47,6 @@ TEST_CASE("Test unique ptr list out of bounds") {
auto v2 = new uint32_t(5000);
ls.Append(v1);
ls.Append(v2);
REQUIRE_THROWS(ls.At(-1));
REQUIRE_THROWS(ls.At(2));
}