From: Daniel R. Carvalho Date: Sun, 7 Feb 2021 02:49:36 +0000 (-0300) Subject: base: Fix storage unit test in .fast X-Git-Tag: develop-gem5-snapshot~129 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b75ff8fcff71cc3cdb141c2fbc642cb35c7d2281;p=gem5.git base: Fix storage unit test in .fast These tests depend on assertions being triggered, which does not happen in .fast. Change-Id: I0dd78f184809a453035046bc76640dfb5988bb5f Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40835 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/src/base/stats/storage.test.cc b/src/base/stats/storage.test.cc index 78df23d06..3218438b4 100644 --- a/src/base/stats/storage.test.cc +++ b/src/base/stats/storage.test.cc @@ -175,6 +175,7 @@ TEST(StatsAvgStorTest, SetValueResult) increaseTick(); } +#if TRACING_ON /** * Test whether getting the result in a different tick triggers an assertion. */ @@ -184,6 +185,7 @@ TEST(StatsAvgStorDeathTest, Result) increaseTick(); ASSERT_DEATH(stor.result(), ".+"); } +#endif /** * Test whether getting the result in a different tick does not trigger an @@ -266,6 +268,7 @@ TEST(StatsAvgStorTest, ZeroReset) ASSERT_FALSE(stor.zero()); } +#if TRACING_ON /** Test that an assertion is thrown when bucket size is 0. */ TEST(StatsDistStorDeathTest, BucketSize0) { @@ -273,6 +276,7 @@ TEST(StatsDistStorDeathTest, BucketSize0) EXPECT_ANY_THROW(Stats::DistStor::Params params(0, 5, 0)); testing::internal::GetCapturedStderr(); } +#endif /** * Test whether zero is correctly set as the reset value. The test order is @@ -492,6 +496,7 @@ TEST(StatsDistStorTest, Reset) checkExpectedDistData(data, expected_data, true); } +#if TRACING_ON /** Test that an assertion is thrown when not enough buckets are provided. */ TEST(StatsHistStorDeathTest, NotEnoughBuckets0) { @@ -507,6 +512,7 @@ TEST(StatsHistStorDeathTest, NotEnoughBuckets1) EXPECT_ANY_THROW(Stats::HistStor::Params params(1)); testing::internal::GetCapturedStderr(); } +#endif /** * Test whether zero is correctly set as the reset value. The test order is @@ -913,6 +919,7 @@ TEST(StatsHistStorTest, Reset) prepareCheckHistStor(params, values, 0, expected_data); } +#if TRACING_ON /** Test whether adding storages with different sizes triggers an assertion. */ TEST(StatsHistStorDeathTest, AddDifferentSize) { @@ -942,6 +949,7 @@ TEST(StatsHistStorDeathTest, AddDifferentMin) ASSERT_DEATH(stor.add(&stor2), ".+"); } +#endif /** Test merging two histograms. */ TEST(StatsHistStorTest, Add)