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 <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40555
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
This commit is contained in:
Daniel R. Carvalho
2021-02-03 18:15:10 -03:00
committed by Daniel Carvalho
parent 3c915a2e84
commit 0f7441fa2d

View File

@@ -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(&params);
// 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(&params);
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(&params);
// 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(&params);
ASSERT_EQ(stor.size(), 1);