Overhaul memory model to new Arbutils memory.
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2020-12-12 12:22:48 +01:00
parent 1dc3aafd33
commit 5c39694f19
33 changed files with 279 additions and 211 deletions

View File

@@ -26,7 +26,6 @@ TEST_CASE("Script Aggregator properly iterates containing script.") {
auto aggr = ScriptAggregator(vec);
while (aggr.HasNext()) {
auto next = aggr.GetNext();
REQUIRE(next != nullptr);
next.As<TestScript>()->TestMethod(ran);
}
CHECK(ran == 1);
@@ -44,7 +43,6 @@ TEST_CASE("Script Aggregator properly iterates multiple scripts.") {
auto aggr = ScriptAggregator(vec);
while (aggr.HasNext()) {
auto next = aggr.GetNext();
REQUIRE(next != nullptr);
next.As<TestScript>()->TestMethod(ran);
}
CHECK(ran == 3);
@@ -63,8 +61,7 @@ TEST_CASE("Script Aggregator properly iterates Script Set.") {
auto aggr = ScriptAggregator(vec);
while (aggr.HasNext()) {
auto next = aggr.GetNextNotNull();
REQUIRE(next != nullptr);
next.As<TestScript>()->TestMethod(ran);
next.value().As<TestScript>()->TestMethod(ran);
}
CHECK(ran == 3);
}
@@ -82,8 +79,7 @@ TEST_CASE("Script Aggregator properly iterates data of Script Set and Script.")
auto aggr = ScriptAggregator(vec);
while (aggr.HasNext()) {
auto next = aggr.GetNextNotNull();
REQUIRE(next != nullptr);
next.As<TestScript>()->TestMethod(ran);
next.value().As<TestScript>()->TestMethod(ran);
}
CHECK(ran == 3);
}
@@ -101,8 +97,7 @@ TEST_CASE("Script Aggregator properly iterates data of Script and Script Set.")
auto aggr = ScriptAggregator(vec);
while (aggr.HasNext()) {
auto next = aggr.GetNextNotNull();
REQUIRE(next != nullptr);
next.As<TestScript>()->TestMethod(ran);
next.value().As<TestScript>()->TestMethod(ran);
}
CHECK(ran == 3);
}
@@ -122,8 +117,7 @@ TEST_CASE("Script Aggregator properly iterates data of Script, Script Set and Sc
auto aggr = ScriptAggregator(vec);
while (aggr.HasNext()) {
auto next = aggr.GetNextNotNull();
REQUIRE(next != nullptr);
next.As<TestScript>()->TestMethod(ran);
next.value().As<TestScript>()->TestMethod(ran);
}
CHECK(ran == 4);
}

View File

@@ -76,8 +76,8 @@ TEST_CASE("Script source with single item script set.") {
source.Set.Add(s);
auto scripts = source.GetScriptIterator();
auto first = scripts.GetNextNotNull();
CHECK(first != nullptr);
CHECK(first->GetName() == "foobar");
REQUIRE(first.has_value());
CHECK(first.value()->GetName() == "foobar");
}
TEST_CASE("Script source with multiple item script set.") {
@@ -88,11 +88,11 @@ TEST_CASE("Script source with multiple item script set.") {
source.Set.Add(s2);
auto scripts = source.GetScriptIterator();
auto first = scripts.GetNextNotNull();
REQUIRE(first != nullptr);
CHECK(first->GetName() == "foobar");
REQUIRE(first.has_value());
CHECK(first.value()->GetName() == "foobar");
auto second = scripts.GetNextNotNull();
REQUIRE(second != nullptr);
CHECK(second->GetName() == "foobar2");
REQUIRE(second.has_value());
CHECK(second.value()->GetName() == "foobar2");
}
#endif