1#include <gmock/gmock.h>
2#include "storm-config.h"
11TEST(DftValidatorTest, Cyclic) {
12 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/cyclic.dft";
16TEST(DftValidatorTest, NonBinaryDependency) {
17 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/fdep.dft";
21 EXPECT_FALSE(result.first);
22 EXPECT_THAT(result.second, ::testing::MatchesRegex(
"DFT has dependency with more than one dependent event."));
25TEST(DftValidatorTest, MultipleConstantFailed) {
26 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/const_be_test.dft";
30 EXPECT_FALSE(result.first);
31 EXPECT_THAT(result.second, ::testing::MatchesRegex(
"DFT has more than one constant failed BE."));
34TEST(DftValidatorTest, OverlappingSpareModules) {
35 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/spare_overlapping.dft";
39 EXPECT_FALSE(result.first);
40 EXPECT_THAT(result.second, ::testing::MatchesRegex(
"Spare modules .* should not overlap."));
43TEST(DftValidatorTest, SharedPrimaryModule) {
44 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/spare_shared_primary.dft";
48 EXPECT_FALSE(result.first);
49 EXPECT_THAT(result.second, ::testing::HasSubstr(
"shared primary module"));
52TEST(DftValidatorTest, SpareConstantFailed) {
53 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/spare_const_failed.dft";
57 EXPECT_FALSE(result.first);
58 EXPECT_THAT(result.second, ::testing::MatchesRegex(
"Spare module of .* contains a constant failed BE .*"));
61TEST(DftValidatorTest, NonExponential) {
62 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/all_be_distributions.dft";
66 EXPECT_FALSE(result.first);
67 EXPECT_THAT(result.second, ::testing::HasSubstr(
"DFT has BE distributions which are neither exponential nor constant failed/failsafe."));
70TEST(DftValidatorTest, OverlappingWithTopModule) {
71 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/modules3.dft";
75 EXPECT_TRUE(result.first);
76 EXPECT_THAT(result.second, ::testing::HasSubstr(
" All elements of this spare module will be activated from the beginning on."));
79TEST(DftValidatorTest, SpareModuleContainsParent) {
80 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/spare_contains_spare.dft";
84 EXPECT_TRUE(result.first);
85 EXPECT_THAT(result.second, ::testing::HasSubstr(
"also contains the parent SPARE-gate"));
86 EXPECT_THAT(result.second, ::testing::HasSubstr(
"This can prevent proper activation of the spare module."));
89TEST(DftValidatorTest, NoModelingIssues) {
std::shared_ptr< storm::dft::storage::DFT< ValueType > > loadDFTGalileoFile(std::string const &file)
Load DFT from Galileo file.
std::pair< bool, std::string > isWellFormed(storm::dft::storage::DFT< ValueType > const &dft, bool validForMarkovianAnalysis)
Check whether the DFT is well-formed.
std::pair< bool, std::string > hasPotentialModelingIssues(storm::dft::storage::DFT< ValueType > const &dft)
Check whether the DFT has potential modeling issues.
#define STORM_SILENT_EXPECT_THROW(statement, expected_exception)