From: Daniel R. Carvalho Date: Wed, 3 Feb 2021 21:15:10 +0000 (-0300) Subject: base: Fix storage params safe_cast X-Git-Tag: develop-gem5-snapshot~135 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0f7441fa2d7fe02f403537866ca55940369f93b7;p=gem5.git base: Fix storage params safe_cast Although they provide the exact same behavior, the params created in the tests did not have the type expected by the internal safe cast. The following error was triggered: storage.test.debug: build/NULL/base/cast.hh:47: T safe_cast(U) [with T = const Stats::SampleStor::Params*; U = const Stats::StorageParams*]: Assertion `ret' failed. Change-Id: I4f2ba51f3ccdb44589e61f235997245e7d9bf3c9 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40555 Tested-by: kokoro Reviewed-by: Bobby R. Bruce Maintainer: Bobby R. Bruce --- diff --git a/src/base/stats/storage.test.cc b/src/base/stats/storage.test.cc index 717c881a8..8a4f6ed5e 100644 --- a/src/base/stats/storage.test.cc +++ b/src/base/stats/storage.test.cc @@ -1083,7 +1083,7 @@ TEST(StatsSampleStorTest, SamplePrepare) Stats::Counter val; Stats::DistData data; Stats::DistData expected_data; - Stats::DistParams params(Stats::Deviation); + Stats::SampleStor::Params params; MockInfo info(¶ms); // Simple test with one value being sampled @@ -1133,7 +1133,7 @@ TEST(StatsSampleStorTest, Size) Stats::Counter val = 10; Stats::Counter num_samples = 5; Stats::DistData data; - Stats::DistParams params(Stats::Deviation); + Stats::SampleStor::Params params; MockInfo info(¶ms); ASSERT_EQ(stor.size(), 1); @@ -1177,7 +1177,7 @@ TEST(StatsAvgSampleStorTest, SamplePrepare) Stats::Counter val; Stats::DistData data; Stats::DistData expected_data; - Stats::DistParams params(Stats::Deviation); + Stats::AvgSampleStor::Params params; MockInfo info(¶ms); // Simple test with one value being sampled @@ -1228,7 +1228,7 @@ TEST(StatsAvgSampleStorTest, Size) Stats::Counter val = 10; Stats::Counter num_samples = 5; Stats::DistData data; - Stats::DistParams params(Stats::Deviation); + Stats::AvgSampleStor::Params params; MockInfo info(¶ms); ASSERT_EQ(stor.size(), 1);