|
@@ -52,12 +52,14 @@ private:
|
|
|
const static int max_ = 10;
|
|
|
};
|
|
|
|
|
|
-/// Some validation tests will incur performance penalty, so the tests are
|
|
|
-/// made only in "debug" version with assert(). But if NDEBUG is defined
|
|
|
-/// the tests will be failed since assert() is non-op in non-debug version.
|
|
|
-/// The "#ifndef NDEBUG" is added to make the tests be performed only in
|
|
|
-/// non-debug environment.
|
|
|
-#ifndef NDEBUG
|
|
|
+// Some validation tests will incur performance penalty, so the tests are
|
|
|
+// made only in "debug" version with assert(). But if NDEBUG is defined
|
|
|
+// the tests will be failed since assert() is non-op in non-debug version.
|
|
|
+// The "#ifndef NDEBUG" is added to make the tests be performed only in
|
|
|
+// non-debug environment.
|
|
|
+// Note: the death test is not supported by all platforms. We need to
|
|
|
+// compile tests using it selectively.
|
|
|
+#if !defined(NDEBUG) && defined(GTEST_HAS_DEATH_TEST)
|
|
|
// Test of the constructor
|
|
|
TEST_F(UniformRandomIntegerGeneratorTest, Constructor) {
|
|
|
// The range must be min<=max
|
|
@@ -107,7 +109,7 @@ TEST_F(WeightedRandomIntegerGeneratorTest, Constructor) {
|
|
|
/// the tests will be failed since assert() is non-op in non-debug version.
|
|
|
/// The "#ifndef NDEBUG" is added to make the tests be performed only in
|
|
|
/// non-debug environment.
|
|
|
-#ifndef NDEBUG
|
|
|
+#if !defined(NDEBUG) && defined(GTEST_HAS_DEATH_TEST)
|
|
|
//The probability must be >= 0
|
|
|
probabilities.push_back(-0.1);
|
|
|
probabilities.push_back(1.1);
|