Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
StateLabelingTest.cpp
Go to the documentation of this file.
1#include "storm-config.h"
2#include "test/storm_gtest.h"
3
5
6TEST(StateLabelingTest, RemoveLabel) {
8 EXPECT_EQ(10ul, labeling.getNumberOfItems());
9 EXPECT_EQ(0ul, labeling.getNumberOfLabels());
10
11 storm::storage::BitVector statesTest1 = storm::storage::BitVector(10, {1, 4, 6, 7});
12 labeling.addLabel("test1", statesTest1);
13 EXPECT_TRUE(labeling.containsLabel("test1"));
14 EXPECT_FALSE(labeling.containsLabel("abc"));
15
16 storm::storage::BitVector statesTest2 = storm::storage::BitVector(10, {2, 6, 7, 8, 9});
17 labeling.addLabel("test2", statesTest2);
18
19 EXPECT_FALSE(labeling.getStateHasLabel("test2", 5));
20 labeling.addLabelToState("test2", 5);
21 EXPECT_TRUE(labeling.getStateHasLabel("test2", 5));
22
23 EXPECT_TRUE(labeling.getStateHasLabel("test1", 4));
24 labeling.removeLabelFromState("test1", 4);
25 EXPECT_FALSE(labeling.getStateHasLabel("test1", 4));
26
27 EXPECT_EQ(2ul, labeling.getNumberOfLabels());
28 EXPECT_TRUE(labeling.getStateHasLabel("test1", 6));
29 labeling.removeLabel("test1");
30 EXPECT_FALSE(labeling.containsLabel("test1"));
31 EXPECT_EQ(1ul, labeling.getNumberOfLabels());
32 EXPECT_TRUE(labeling.getStateHasLabel("test2", 5));
33}
TEST(StateLabelingTest, RemoveLabel)
void addLabel(std::string const &label)
Adds a new label to the labelings.
bool containsLabel(std::string const &label) const
Checks whether a label is registered within this labeling.
std::size_t getNumberOfItems() const
Returns the number of items managed by this object.
void removeLabel(std::string const &label)
Removes a label from the labelings.
std::size_t getNumberOfLabels() const
Returns the number of labels managed by this object.
This class manages the labeling of the state space with a number of (atomic) labels.
bool getStateHasLabel(std::string const &label, storm::storage::sparse::state_type state) const
Checks whether a given state is labeled with the given label.
void addLabelToState(std::string const &label, storm::storage::sparse::state_type state)
Adds a label to a given state.
void removeLabelFromState(std::string const &label, storm::storage::sparse::state_type state)
Removes a label from a given state.
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18