More sanitizers, fixes several errors caught by these.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user