1#include "gmock/gmock.h"
2#include "storm-config.h"
10TEST(DftValidatorTest, Cyclic) {
11 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/cyclic.dft";
15TEST(DftValidatorTest, NonBinaryDependency) {
16 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/fdep.dft";
17 std::shared_ptr<storm::dft::storage::DFT<double>> dft = storm::dft::api::loadDFTGalileoFile<double>(file);
20 EXPECT_FALSE(result.first);
21 EXPECT_THAT(result.second, ::testing::MatchesRegex(
"DFT has dependency with more than one dependent event."));
24TEST(DftValidatorTest, MultipleConstantFailed) {
25 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/const_be_test.dft";
26 std::shared_ptr<storm::dft::storage::DFT<double>> dft = storm::dft::api::loadDFTGalileoFile<double>(file);
29 EXPECT_FALSE(result.first);
30 EXPECT_THAT(result.second, ::testing::MatchesRegex(
"DFT has more than one constant failed BE."));
33TEST(DftValidatorTest, OverlappingSpareModules) {
34 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/spare_overlapping.dft";
35 std::shared_ptr<storm::dft::storage::DFT<double>> dft = storm::dft::api::loadDFTGalileoFile<double>(file);
38 EXPECT_FALSE(result.first);
39 EXPECT_THAT(result.second, ::testing::MatchesRegex(
"Spare modules .* should not overlap."));
42TEST(DftValidatorTest, SharedPrimaryModule) {
43 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/spare_shared_primary.dft";
44 std::shared_ptr<storm::dft::storage::DFT<double>> dft = storm::dft::api::loadDFTGalileoFile<double>(file);
47 EXPECT_FALSE(result.first);
48 EXPECT_THAT(result.second, ::testing::HasSubstr(
"shared primary module"));
51TEST(DftValidatorTest, SpareConstantFailed) {
52 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/spare_const_failed.dft";
53 std::shared_ptr<storm::dft::storage::DFT<double>> dft = storm::dft::api::loadDFTGalileoFile<double>(file);
56 EXPECT_FALSE(result.first);
57 EXPECT_THAT(result.second, ::testing::MatchesRegex(
"Spare module of .* contains a constant failed BE .*"));
60TEST(DftValidatorTest, NonExponential) {
61 std::string file = STORM_TEST_RESOURCES_DIR
"/dft/all_be_distributions.dft";
62 std::shared_ptr<storm::dft::storage::DFT<double>> dft = storm::dft::api::loadDFTGalileoFile<double>(file);
65 EXPECT_FALSE(result.first);
66 EXPECT_THAT(result.second, ::testing::HasSubstr(
"DFT has BE distributions which are neither exponential nor constant failed/failsafe."));
std::pair< bool, std::string > isWellFormed(storm::dft::storage::DFT< ValueType > const &dft, bool validForMarkovianAnalysis=true)
Check whether the DFT is well-formed.
#define STORM_SILENT_EXPECT_THROW(statement, expected_exception)