gem5 v24.0.0.0
|
#include <gtest/gtest-spi.h>
#include <gtest/gtest.h>
#include <cmath>
#include "base/gtest/cur_tick_fake.hh"
#include "base/gtest/logging.hh"
#include "base/stats/storage.hh"
Go to the source code of this file.
Classes | |
struct | ValueSamples |
A pair of value and its number of samples, used for sampling. More... | |
Functions | |
void | increaseTick () |
Increases the current tick by one. | |
TEST (StatsStatStorTest, SetValueResult) | |
Test setting and getting a value to the storage. | |
TEST (StatsStatStorTest, Prepare) | |
Test if prepare does not change the value. | |
TEST (StatsStatStorTest, IncDec) | |
Test whether incrementing and decrementing work as expected. | |
TEST (StatsStatStorTest, ZeroReset) | |
Test whether zero is correctly set as the reset value. | |
TEST (StatsAvgStorTest, SetValueResult) | |
Test setting and getting a value to the storage. | |
TEST (StatsAvgStorTest, Prepare) | |
Test whether getting the result in a different tick does not trigger an assertion if storage is prepared. | |
TEST (StatsAvgStorTest, IncDec) | |
Test whether incrementing and decrementing work as expected. | |
TEST (StatsAvgStorTest, ZeroReset) | |
Test whether zero is correctly set as the reset value. | |
TEST (StatsDistStorTest, ZeroReset) | |
Test whether zero is correctly set as the reset value. | |
TEST (StatsDistStorTest, Size) | |
Test that the size of this storage is equal to its counters vector's size, and that after it has been set, nothing can modify it. | |
void | checkExpectedDistData (const statistics::DistData &data, const statistics::DistData &expected_data, bool no_log=true) |
Compare both dist datas to see if their contents match. | |
void | prepareCheckDistStor (statistics::DistStor::Params ¶ms, ValueSamples *values, int num_values, statistics::DistData &expected_data) |
Auxiliary function that finishes preparing the DistStor's expected values, perform the calls to the storage's sample, and compares the expected data. | |
TEST (StatsDistStorTest, SamplePrepareSingle) | |
Test setting and getting value from storage. | |
TEST (StatsDistStorTest, SamplePrepareMultiple) | |
Test setting and getting value from storage with multiple values. | |
TEST (StatsDistStorTest, Reset) | |
Test resetting storage. | |
TEST (StatsHistStorTest, ZeroReset) | |
Test whether zero is correctly set as the reset value. | |
TEST (StatsHistStorTest, Size) | |
Test that the size of this storage is equal to its counters vector's size, and that after it has been set, nothing can modify it. | |
void | prepareCheckHistStor (statistics::HistStor::Params ¶ms, ValueSamples *values, int num_values, statistics::DistData &expected_data) |
Auxiliary function that finishes preparing the HistStor's expected values, perform the calls to the storage's sample, and compares the expected data. | |
TEST (StatsHistStorTest, SamplePrepareFit) | |
Test samples that fit in the initial buckets, and therefore do not need to grow up. | |
TEST (StatsHistStorTest, SamplePrepareSingleGrowUp) | |
Test samples that do not fit in the initial buckets, and therefore have to grow up once. | |
TEST (StatsHistStorTest, SamplePrepareMultipleGrowUp) | |
Test samples that do not fit in the initial buckets, and therefore have to grow up a few times. | |
TEST (StatsHistStorTest, SamplePrepareGrowDownOddBuckets) | |
Test samples that have a negative value, and therefore do not fit in the initial buckets. | |
TEST (StatsHistStorTest, SamplePrepareGrowDownEvenBuckets) | |
Test samples that have a negative value, and therefore do not fit in the initial buckets. | |
TEST (StatsHistStorTest, SamplePrepareGrowDownGrowOutOddBuckets) | |
Test samples that have one low negative value, and therefore do not fit in the initial buckets and have to grow down a few times. | |
TEST (StatsHistStorTest, SamplePrepareGrowDownGrowOutEvenBuckets) | |
Test samples that have one low negative value, and therefore do not fit in the initial buckets and have to grow down a few times. | |
TEST (StatsHistStorTest, SamplePrepareMultipleGrowOddBuckets) | |
Test a complex sample set with negative values, and therefore multiple grows will happen. | |
TEST (StatsHistStorTest, SamplePrepareMultipleGrowEvenBuckets) | |
Test a complex sample set with negative values, and therefore multiple grows will happen. | |
TEST (StatsHistStorTest, Reset) | |
Test resetting storage. | |
TEST (StatsHistStorTest, Add) | |
Test merging two histograms. | |
TEST (StatsSampleStorTest, ZeroReset) | |
Test whether zero is correctly set as the reset value. | |
TEST (StatsSampleStorTest, SamplePrepare) | |
Test setting and getting value from storage. | |
TEST (StatsSampleStorTest, Size) | |
The size is always 1, no matter which functions have been called. | |
TEST (StatsAvgSampleStorTest, ZeroReset) | |
Test whether zero is correctly set as the reset value. | |
TEST (StatsAvgSampleStorTest, SamplePrepare) | |
Test setting and getting value from storage. | |
TEST (StatsAvgSampleStorTest, Size) | |
The size is always 1, no matter which functions have been called. | |
TEST (StatsSparseHistStorTest, ZeroReset) | |
Test whether zero is correctly set as the reset value. | |
TEST (StatsSparseHistStorTest, SamplePrepare) | |
Test setting and getting value from storage. | |
Variables | |
GTestTickHandler | tickHandler |
void checkExpectedDistData | ( | const statistics::DistData & | data, |
const statistics::DistData & | expected_data, | ||
bool | no_log = true ) |
Compare both dist datas to see if their contents match.
data | The data being tested. |
expected_data | The ground truth. |
no_log | Whether log should not be compared. |
Definition at line 315 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, gem5::statistics::DistData::cvec, data, gem5::ArmISA::i, gem5::statistics::DistData::logs, gem5::statistics::DistData::max, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min, gem5::statistics::DistData::min_val, gem5::statistics::DistData::samples, gem5::statistics::DistData::squares, gem5::statistics::DistData::sum, and gem5::statistics::DistData::type.
Referenced by prepareCheckDistStor(), prepareCheckHistStor(), TEST(), and TEST().
void increaseTick | ( | ) |
Increases the current tick by one.
Definition at line 44 of file storage.test.cc.
References gem5::curTick(), gem5::GTestTickHandler::setCurTick(), and tickHandler.
void prepareCheckDistStor | ( | statistics::DistStor::Params & | params, |
ValueSamples * | values, | ||
int | num_values, | ||
statistics::DistData & | expected_data ) |
Auxiliary function that finishes preparing the DistStor's expected values, perform the calls to the storage's sample, and compares the expected data.
params | The params containing the number of buckets. |
values | The value-num_sample pairs to be sampled. |
num_values | Number of values in the values array. |
expected_data | Expected data after sampling, with the following values setup to the expected values: bucket_size, min, max_val, and cvec. |
Definition at line 347 of file storage.test.cc.
References checkExpectedDistData(), data, gem5::ArmISA::i, gem5::statistics::DistData::logs, gem5::statistics::DistData::max, gem5::statistics::DistStor::Params::max, gem5::statistics::DistData::min, gem5::statistics::DistStor::Params::min, ValueSamples::numSamples, gem5::statistics::DistStor::prepare(), gem5::statistics::DistStor::sample(), gem5::statistics::DistData::samples, gem5::statistics::DistData::squares, gem5::statistics::DistData::sum, gem5::X86ISA::val, and ValueSamples::value.
void prepareCheckHistStor | ( | statistics::HistStor::Params & | params, |
ValueSamples * | values, | ||
int | num_values, | ||
statistics::DistData & | expected_data ) |
Auxiliary function that finishes preparing the HistStor's expected values, perform the calls to the storage's sample, and compares the expected data.
params | The params containing the number of buckets. |
values | The value-num_sample pairs to be sampled. |
num_values | Number of values in the values array. |
expected_data | Expected data after sampling, with the following values setup to the expected values: bucket_size, min, max_val, and cvec. |
Definition at line 548 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, checkExpectedDistData(), data, gem5::ArmISA::i, gem5::statistics::DistData::logs, gem5::statistics::DistData::max, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min, gem5::statistics::DistData::min_val, ValueSamples::numSamples, gem5::statistics::HistStor::prepare(), gem5::statistics::HistStor::sample(), gem5::statistics::DistData::samples, gem5::statistics::DistData::squares, gem5::statistics::DistData::sum, gem5::X86ISA::val, and ValueSamples::value.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
TEST | ( | StatsAvgSampleStorTest | , |
SamplePrepare | ) |
Test setting and getting value from storage.
Definition at line 1087 of file storage.test.cc.
References gem5::curTick(), data, gem5::statistics::Deviation, gem5::ArmISA::i, increaseTick(), ValueSamples::numSamples, gem5::statistics::AvgSampleStor::prepare(), gem5::statistics::AvgSampleStor::reset(), gem5::statistics::AvgSampleStor::sample(), gem5::statistics::DistData::squares, gem5::statistics::DistData::sum, gem5::statistics::DistData::type, gem5::X86ISA::val, and ValueSamples::value.
TEST | ( | StatsAvgSampleStorTest | , |
Size | ) |
The size is always 1, no matter which functions have been called.
Definition at line 1139 of file storage.test.cc.
References data, gem5::statistics::AvgSampleStor::prepare(), gem5::statistics::AvgSampleStor::reset(), gem5::statistics::AvgSampleStor::sample(), gem5::statistics::AvgSampleStor::size(), gem5::X86ISA::val, and gem5::statistics::AvgSampleStor::zero().
TEST | ( | StatsAvgSampleStorTest | , |
ZeroReset | ) |
Test whether zero is correctly set as the reset value.
The test order is to check if it is initially zero on creation, then it is made non zero, and finally reset to zero.
Definition at line 1070 of file storage.test.cc.
References gem5::statistics::AvgSampleStor::reset(), gem5::statistics::AvgSampleStor::sample(), gem5::X86ISA::val, and gem5::statistics::AvgSampleStor::zero().
TEST | ( | StatsAvgStorTest | , |
IncDec | ) |
Test whether incrementing and decrementing work as expected.
Definition at line 201 of file storage.test.cc.
References gem5::statistics::AvgStor::dec(), gem5::statistics::AvgStor::inc(), gem5::statistics::AvgStor::set(), gem5::X86ISA::val, and gem5::statistics::AvgStor::value().
TEST | ( | StatsAvgStorTest | , |
Prepare | ) |
Test whether getting the result in a different tick does not trigger an assertion if storage is prepared.
Definition at line 175 of file storage.test.cc.
References gem5::curTick(), increaseTick(), gem5::statistics::AvgStor::prepare(), gem5::statistics::AvgStor::result(), gem5::statistics::AvgStor::set(), gem5::statistics::total, gem5::X86ISA::val, and gem5::statistics::AvgStor::value().
TEST | ( | StatsAvgStorTest | , |
SetValueResult | ) |
Test setting and getting a value to the storage.
Definition at line 133 of file storage.test.cc.
References gem5::curTick(), increaseTick(), gem5::statistics::AvgStor::result(), gem5::statistics::AvgStor::set(), gem5::statistics::total, gem5::X86ISA::val, and gem5::statistics::AvgStor::value().
TEST | ( | StatsAvgStorTest | , |
ZeroReset | ) |
Test whether zero is correctly set as the reset value.
The test order is to check if it is initially zero on creation, then it is made non zero, and finally reset to zero.
Definition at line 233 of file storage.test.cc.
References gem5::statistics::AvgStor::inc(), increaseTick(), gem5::statistics::AvgStor::reset(), gem5::X86ISA::val, and gem5::statistics::AvgStor::zero().
TEST | ( | StatsDistStorTest | , |
Reset | ) |
Test resetting storage.
Definition at line 438 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, gem5::statistics::DistStor::Params::bucket_size, gem5::statistics::DistStor::Params::buckets, checkExpectedDistData(), gem5::statistics::DistData::cvec, data, gem5::statistics::Dist, gem5::ArmISA::i, gem5::statistics::DistData::max, gem5::statistics::DistStor::Params::max, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min, gem5::statistics::DistStor::Params::min, gem5::statistics::DistData::min_val, gem5::statistics::DistData::overflow, gem5::statistics::DistStor::prepare(), gem5::statistics::DistStor::reset(), gem5::statistics::DistStor::sample(), gem5::statistics::DistData::samples, gem5::statistics::DistData::squares, gem5::statistics::DistData::sum, gem5::statistics::DistData::type, and gem5::statistics::DistData::underflow.
TEST | ( | StatsDistStorTest | , |
SamplePrepareMultiple | ) |
Test setting and getting value from storage with multiple values.
Definition at line 401 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, gem5::statistics::DistStor::Params::bucket_size, gem5::statistics::DistStor::Params::buckets, gem5::statistics::DistData::cvec, gem5::statistics::Dist, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min_val, gem5::statistics::DistData::overflow, prepareCheckDistStor(), gem5::statistics::DistData::samples, gem5::statistics::DistData::squares, gem5::statistics::DistData::sum, gem5::statistics::DistData::type, and gem5::statistics::DistData::underflow.
TEST | ( | StatsDistStorTest | , |
SamplePrepareSingle | ) |
Test setting and getting value from storage.
Definition at line 378 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, gem5::statistics::DistStor::Params::bucket_size, gem5::statistics::DistStor::Params::buckets, gem5::statistics::DistData::cvec, gem5::statistics::Dist, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min_val, gem5::statistics::DistData::overflow, prepareCheckDistStor(), gem5::statistics::DistData::type, and gem5::statistics::DistData::underflow.
TEST | ( | StatsDistStorTest | , |
Size | ) |
Test that the size of this storage is equal to its counters vector's size, and that after it has been set, nothing can modify it.
Definition at line 286 of file storage.test.cc.
References data, gem5::statistics::DistStor::prepare(), gem5::statistics::DistStor::reset(), gem5::statistics::DistStor::sample(), gem5::statistics::DistStor::size(), gem5::X86ISA::val, and gem5::statistics::DistStor::zero().
TEST | ( | StatsDistStorTest | , |
ZeroReset | ) |
Test whether zero is correctly set as the reset value.
The test order is to check if it is initially zero on creation, then it is made non zero, and finally reset to zero.
Definition at line 265 of file storage.test.cc.
References gem5::statistics::DistStor::reset(), gem5::statistics::DistStor::sample(), gem5::X86ISA::val, and gem5::statistics::DistStor::zero().
TEST | ( | StatsHistStorTest | , |
Add | ) |
Test merging two histograms.
Definition at line 918 of file storage.test.cc.
References gem5::statistics::HistStor::add(), gem5::statistics::DistData::bucket_size, gem5::statistics::HistStor::Params::buckets, checkExpectedDistData(), gem5::statistics::DistData::cvec, data, gem5::statistics::Hist, gem5::ArmISA::i, gem5::statistics::DistData::logs, gem5::statistics::DistData::max, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min, gem5::statistics::DistData::min_val, gem5::statistics::HistStor::prepare(), gem5::statistics::HistStor::sample(), gem5::statistics::DistData::samples, gem5::statistics::DistData::squares, gem5::statistics::DistData::sum, and gem5::statistics::DistData::type.
TEST | ( | StatsHistStorTest | , |
Reset | ) |
Test resetting storage.
Definition at line 860 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, gem5::statistics::HistStor::Params::buckets, gem5::statistics::DistData::cvec, gem5::statistics::Hist, gem5::ArmISA::i, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min, prepareCheckHistStor(), gem5::statistics::HistStor::reset(), gem5::statistics::HistStor::sample(), and gem5::statistics::DistData::type.
TEST | ( | StatsHistStorTest | , |
SamplePrepareFit | ) |
Test samples that fit in the initial buckets, and therefore do not need to grow up.
Definition at line 588 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, gem5::statistics::HistStor::Params::buckets, gem5::statistics::DistData::cvec, gem5::statistics::Hist, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min, prepareCheckHistStor(), and gem5::statistics::DistData::type.
TEST | ( | StatsHistStorTest | , |
SamplePrepareGrowDownEvenBuckets | ) |
Test samples that have a negative value, and therefore do not fit in the initial buckets.
Since this involves using negative values, the logs become irrelevant.
Definition at line 707 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, gem5::statistics::HistStor::Params::buckets, gem5::statistics::DistData::cvec, gem5::statistics::Hist, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min, prepareCheckHistStor(), and gem5::statistics::DistData::type.
TEST | ( | StatsHistStorTest | , |
SamplePrepareGrowDownGrowOutEvenBuckets | ) |
Test samples that have one low negative value, and therefore do not fit in the initial buckets and have to grow down a few times.
Since this involves using negative values, the logs become irrelevant.
Definition at line 769 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, gem5::statistics::HistStor::Params::buckets, gem5::statistics::DistData::cvec, gem5::statistics::Hist, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min, prepareCheckHistStor(), and gem5::statistics::DistData::type.
TEST | ( | StatsHistStorTest | , |
SamplePrepareGrowDownGrowOutOddBuckets | ) |
Test samples that have one low negative value, and therefore do not fit in the initial buckets and have to grow down a few times.
Since this involves using negative values, the logs become irrelevant.
Definition at line 737 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, gem5::statistics::HistStor::Params::buckets, gem5::statistics::DistData::cvec, gem5::statistics::Hist, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min, prepareCheckHistStor(), and gem5::statistics::DistData::type.
TEST | ( | StatsHistStorTest | , |
SamplePrepareGrowDownOddBuckets | ) |
Test samples that have a negative value, and therefore do not fit in the initial buckets.
Since this involves using negative values, the logs become irrelevant.
Definition at line 675 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, gem5::statistics::HistStor::Params::buckets, gem5::statistics::DistData::cvec, gem5::statistics::Hist, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min, prepareCheckHistStor(), and gem5::statistics::DistData::type.
TEST | ( | StatsHistStorTest | , |
SamplePrepareMultipleGrowEvenBuckets | ) |
Test a complex sample set with negative values, and therefore multiple grows will happen.
Since this involves using negative values, the logs become irrelevant.
Definition at line 833 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, gem5::statistics::HistStor::Params::buckets, gem5::statistics::DistData::cvec, gem5::statistics::Hist, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min, prepareCheckHistStor(), and gem5::statistics::DistData::type.
TEST | ( | StatsHistStorTest | , |
SamplePrepareMultipleGrowOddBuckets | ) |
Test a complex sample set with negative values, and therefore multiple grows will happen.
Since this involves using negative values, the logs become irrelevant.
Definition at line 800 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, gem5::statistics::HistStor::Params::buckets, gem5::statistics::DistData::cvec, gem5::statistics::Hist, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min, prepareCheckHistStor(), and gem5::statistics::DistData::type.
TEST | ( | StatsHistStorTest | , |
SamplePrepareMultipleGrowUp | ) |
Test samples that do not fit in the initial buckets, and therefore have to grow up a few times.
Definition at line 645 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, gem5::statistics::HistStor::Params::buckets, gem5::statistics::DistData::cvec, gem5::statistics::Hist, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min, prepareCheckHistStor(), and gem5::statistics::DistData::type.
TEST | ( | StatsHistStorTest | , |
SamplePrepareSingleGrowUp | ) |
Test samples that do not fit in the initial buckets, and therefore have to grow up once.
Definition at line 616 of file storage.test.cc.
References gem5::statistics::DistData::bucket_size, gem5::statistics::HistStor::Params::buckets, gem5::statistics::DistData::cvec, gem5::statistics::Hist, gem5::statistics::DistData::max_val, gem5::statistics::DistData::min, prepareCheckHistStor(), and gem5::statistics::DistData::type.
TEST | ( | StatsHistStorTest | , |
Size | ) |
Test that the size of this storage is equal to its counters vector's size, and that after it has been set, nothing can modify it.
Definition at line 514 of file storage.test.cc.
References data, gem5::ArmISA::i, gem5::statistics::HistStor::prepare(), gem5::statistics::HistStor::reset(), gem5::statistics::HistStor::sample(), gem5::statistics::HistStor::size(), gem5::X86ISA::val, and gem5::statistics::HistStor::zero().
TEST | ( | StatsHistStorTest | , |
ZeroReset | ) |
Test whether zero is correctly set as the reset value.
The test order is to check if it is initially zero on creation, then it is made non zero, and finally reset to zero.
Definition at line 493 of file storage.test.cc.
References gem5::statistics::HistStor::reset(), gem5::statistics::HistStor::sample(), gem5::X86ISA::val, and gem5::statistics::HistStor::zero().
TEST | ( | StatsSampleStorTest | , |
SamplePrepare | ) |
Test setting and getting value from storage.
Definition at line 995 of file storage.test.cc.
References data, gem5::statistics::Deviation, gem5::ArmISA::i, ValueSamples::numSamples, gem5::statistics::SampleStor::prepare(), gem5::statistics::SampleStor::reset(), gem5::statistics::SampleStor::sample(), gem5::statistics::DistData::samples, gem5::statistics::DistData::squares, gem5::statistics::DistData::sum, gem5::statistics::DistData::type, gem5::X86ISA::val, and ValueSamples::value.
TEST | ( | StatsSampleStorTest | , |
Size | ) |
The size is always 1, no matter which functions have been called.
Definition at line 1046 of file storage.test.cc.
References data, gem5::statistics::SampleStor::prepare(), gem5::statistics::SampleStor::reset(), gem5::statistics::SampleStor::sample(), gem5::statistics::SampleStor::size(), gem5::X86ISA::val, and gem5::statistics::SampleStor::zero().
TEST | ( | StatsSampleStorTest | , |
ZeroReset | ) |
Test whether zero is correctly set as the reset value.
The test order is to check if it is initially zero on creation, then it is made non zero, and finally reset to zero.
Definition at line 978 of file storage.test.cc.
References gem5::statistics::SampleStor::reset(), gem5::statistics::SampleStor::sample(), gem5::X86ISA::val, and gem5::statistics::SampleStor::zero().
TEST | ( | StatsSparseHistStorTest | , |
SamplePrepare | ) |
Test setting and getting value from storage.
Definition at line 1180 of file storage.test.cc.
References data, gem5::ArmISA::i, ValueSamples::numSamples, gem5::statistics::SparseHistStor::prepare(), gem5::statistics::SparseHistStor::reset(), gem5::statistics::SparseHistStor::sample(), gem5::statistics::SparseHistStor::size(), and ValueSamples::value.
TEST | ( | StatsSparseHistStorTest | , |
ZeroReset | ) |
Test whether zero is correctly set as the reset value.
The test order is to check if it is initially zero on creation, then it is made non zero, and finally reset to zero.
Definition at line 1163 of file storage.test.cc.
References gem5::statistics::SparseHistStor::reset(), gem5::statistics::SparseHistStor::sample(), gem5::X86ISA::val, and gem5::statistics::SparseHistStor::zero().
TEST | ( | StatsStatStorTest | , |
IncDec | ) |
Test whether incrementing and decrementing work as expected.
Definition at line 89 of file storage.test.cc.
References gem5::statistics::StatStor::dec(), gem5::statistics::StatStor::inc(), gem5::X86ISA::val, and gem5::statistics::StatStor::value().
TEST | ( | StatsStatStorTest | , |
Prepare | ) |
Test if prepare does not change the value.
Definition at line 76 of file storage.test.cc.
References gem5::statistics::StatStor::prepare(), gem5::statistics::StatStor::result(), gem5::statistics::StatStor::set(), gem5::X86ISA::val, and gem5::statistics::StatStor::value().
TEST | ( | StatsStatStorTest | , |
SetValueResult | ) |
Test setting and getting a value to the storage.
Definition at line 59 of file storage.test.cc.
References gem5::statistics::StatStor::result(), gem5::statistics::StatStor::set(), gem5::X86ISA::val, and gem5::statistics::StatStor::value().
TEST | ( | StatsStatStorTest | , |
ZeroReset | ) |
Test whether zero is correctly set as the reset value.
The test order is to check if it is initially zero on creation, then it is made non zero, and finally reset to zero.
Definition at line 117 of file storage.test.cc.
References gem5::statistics::StatStor::inc(), gem5::statistics::StatStor::reset(), gem5::X86ISA::val, and gem5::statistics::StatStor::zero().
GTestTickHandler tickHandler |
Definition at line 41 of file storage.test.cc.
Referenced by increaseTick().