From a39f297b8c3f0dc26daecb1157b272ad2a769236 Mon Sep 17 00:00:00 2001 From: Jip Spel Date: Tue, 15 Oct 2019 14:47:41 +0200 Subject: [PATCH] Fix OrderTest and add assert in Order --- src/storm-pars/analysis/Order.cpp | 1 + src/test/storm-pars/analysis/OrderTest.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/storm-pars/analysis/Order.cpp b/src/storm-pars/analysis/Order.cpp index 476a9e058..3c16f750f 100644 --- a/src/storm-pars/analysis/Order.cpp +++ b/src/storm-pars/analysis/Order.cpp @@ -14,6 +14,7 @@ namespace storm { this->numberOfStates = numberOfStates; this->addedStates = new storm::storage::BitVector(numberOfStates); this->doneBuilding = false; + assert (statesSorted != nullptr); this->statesSorted = *statesSorted; this->statesToHandle = initialMiddleStates; diff --git a/src/test/storm-pars/analysis/OrderTest.cpp b/src/test/storm-pars/analysis/OrderTest.cpp index 8b712508b..fc5d78709 100644 --- a/src/test/storm-pars/analysis/OrderTest.cpp +++ b/src/test/storm-pars/analysis/OrderTest.cpp @@ -11,8 +11,9 @@ TEST(OrderTest, Simple) { auto below = storm::storage::BitVector(numberOfStates); below.set(1); auto initialMiddle = storm::storage::BitVector(numberOfStates); + std::vector statesSorted; - auto order = storm::analysis::Order(&above, &below, &initialMiddle, numberOfStates, nullptr); + auto order = storm::analysis::Order(&above, &below, &initialMiddle, numberOfStates, &statesSorted); EXPECT_EQ(storm::analysis::Order::NodeComparison::ABOVE, order.compare(0,1)); EXPECT_EQ(storm::analysis::Order::NodeComparison::BELOW, order.compare(1,0)); EXPECT_EQ(nullptr, order.getNode(2)); @@ -77,8 +78,9 @@ TEST(OrderTest, copy_order) { auto below = storm::storage::BitVector(numberOfStates); below.set(1); auto initialMiddle = storm::storage::BitVector(numberOfStates); + std::vector statesSorted; - auto order = storm::analysis::Order(&above, &below, &initialMiddle, numberOfStates, nullptr); + auto order = storm::analysis::Order(&above, &below, &initialMiddle, numberOfStates, &statesSorted); order.add(2); order.add(3); order.addToNode(4, order.getNode(2)); @@ -142,8 +144,9 @@ TEST(OrderTest, merge_nodes) { auto below = storm::storage::BitVector(numberOfStates); below.set(1); auto initialMiddle = storm::storage::BitVector(numberOfStates); + std::vector statesSorted; - auto order = storm::analysis::Order(&above, &below, &initialMiddle, numberOfStates, nullptr); + auto order = storm::analysis::Order(&above, &below, &initialMiddle, numberOfStates, &statesSorted); order.add(2); order.add(3); order.addToNode(4, order.getNode(2));