From e156d7b8e798141f7a86638cc13dcbc905b73835 Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Wed, 27 Jan 2021 10:21:39 +0100 Subject: [PATCH] Prevent problems with different random values on older Boost versions --- src/test/storm-dft/simulator/DftTraceGeneratorTest.cpp | 8 +++++++- src/test/storm-dft/simulator/SamplingTest.cpp | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/test/storm-dft/simulator/DftTraceGeneratorTest.cpp b/src/test/storm-dft/simulator/DftTraceGeneratorTest.cpp index 95630a64d..5bdc5de3a 100644 --- a/src/test/storm-dft/simulator/DftTraceGeneratorTest.cpp +++ b/src/test/storm-dft/simulator/DftTraceGeneratorTest.cpp @@ -175,12 +175,18 @@ namespace { // First random step double timebound = simulator.randomStep(); +#if BOOST_VERSION > 106400 + // Older Boost versions yield different value EXPECT_FLOAT_EQ(timebound, 0.522079); +#endif state = simulator.getCurrentState(); EXPECT_FALSE(state->hasFailed(dft->getTopLevelIndex())); - + timebound = simulator.randomStep(); +#if BOOST_VERSION > 106400 + // Older Boost versions yield different value EXPECT_FLOAT_EQ(timebound, 0.9497214); +#endif state = simulator.getCurrentState(); EXPECT_TRUE(state->hasFailed(dft->getTopLevelIndex())); } diff --git a/src/test/storm-dft/simulator/SamplingTest.cpp b/src/test/storm-dft/simulator/SamplingTest.cpp index f02ff0031..524947d31 100644 --- a/src/test/storm-dft/simulator/SamplingTest.cpp +++ b/src/test/storm-dft/simulator/SamplingTest.cpp @@ -6,9 +6,15 @@ namespace { TEST(SamplingTest, SampleExponential) { +#if BOOST_VERSION < 106400 + // Boost changed implementation of exponential distribution + // -> different values are returned + GTEST_SKIP(); + return; +#endif boost::mt19937 gen(5u); storm::utility::ExponentialDistributionGenerator dist(5); - + // Ensure that pseudo random numbers are the same on all machines double reference[] = {0.18241937154, 0.0522078772595, 0.0949721368604, 0.246869315378, 0.765000791199, 0.0177096648877, 0.225167598601, 0.23538530391, 1.01605360643, 0.138846355094}; for (int i =0; i < 10; ++i) {