|
gem5 [DEVELOP-FOR-25.1]
|
#include <gtest/gtest-spi.h>#include <gtest/gtest.h>#include <cassert>#include "base/filters/base.hh"Go to the source code of this file.
Classes | |
| class | TestFilter |
| Simulates basic behavior of a bloom filter. More... | |
Macros | |
| #define | GEM5_DECLARE_FILTER_PARAMS(name) |
Functions | |
| TEST (BloomFilterBaseTest, Construct) | |
| Test that a filter is initialized in a cleared state. | |
| TEST (BloomFilterBaseTest, SingleIsSet) | |
| Test that setting a single entry when the threshold is 1 will only set that entry, and no other entry. | |
| TEST (BloomFilterBaseTest, MultipleIsSet) | |
| Test that isSet works for multiple simultaneously set entries by simultaneously saturating different entries at the same time. | |
| TEST (BloomFilterBaseTest, SingleIsSetThreshold) | |
| Test that isSet takes the threshold into consideration. | |
| TEST (BloomFilterBaseTest, MergeBothEmpty) | |
| Test that merging two empty bloom filters results in an empty filter. | |
| TEST (BloomFilterBaseTest, MergeWithEmpty) | |
| Test that merging a populated filter with an empty filter does not modify any of the filters. | |
| TEST (BloomFilterBaseTest, MergeWithEmpty2) | |
| Test that merging an empty filter with a populated filter results in two equal filters. | |
| TEST (BloomFilterBaseTest, MergeNoIntersection) | |
| Test merging two filters with intersecting entries. | |
| TEST (BloomFilterBaseTest, MergeIntersectionThreshold1) | |
| Test merging two filters with insersecting entries and threshold at 1. | |
| TEST (BloomFilterBaseTest, MergeIntersectionThreshold2) | |
| Test merging two filters with insersecting entries and threshold at 2. | |
| TEST (BloomFilterBaseDeathTest, MergeDifferent) | |
| Test that trying to merge filters of different sizes fails. | |
| #define GEM5_DECLARE_FILTER_PARAMS | ( | name | ) |
| TEST | ( | BloomFilterBaseDeathTest | , |
| MergeDifferent | ) |
Test that trying to merge filters of different sizes fails.
Definition at line 374 of file base.test.cc.
References GEM5_DECLARE_FILTER_PARAMS, and gem5::bloom_filter::Base::merge().
| TEST | ( | BloomFilterBaseTest | , |
| Construct | ) |
Test that a filter is initialized in a cleared state.
Definition at line 68 of file base.test.cc.
References GEM5_DECLARE_FILTER_PARAMS, gem5::bloom_filter::Base::getTotalCount(), gem5::ArmISA::i, and gem5::bloom_filter::Base::isSet().
| TEST | ( | BloomFilterBaseTest | , |
| MergeBothEmpty | ) |
Test that merging two empty bloom filters results in an empty filter.
Definition at line 223 of file base.test.cc.
References GEM5_DECLARE_FILTER_PARAMS, gem5::bloom_filter::Base::getTotalCount(), and gem5::bloom_filter::Base::merge().
| TEST | ( | BloomFilterBaseTest | , |
| MergeIntersectionThreshold1 | ) |
Test merging two filters with insersecting entries and threshold at 1.
Definition at line 307 of file base.test.cc.
References GEM5_DECLARE_FILTER_PARAMS, gem5::bloom_filter::Base::getTotalCount(), gem5::bloom_filter::Base::isSet(), gem5::bloom_filter::Base::merge(), and TestFilter::set().
| TEST | ( | BloomFilterBaseTest | , |
| MergeIntersectionThreshold2 | ) |
Test merging two filters with insersecting entries and threshold at 2.
One entry is populated so that it only reaches the threshold after merging. One entry is populated so that when merged it will become saturated.
Definition at line 342 of file base.test.cc.
References GEM5_DECLARE_FILTER_PARAMS, gem5::bloom_filter::Base::getTotalCount(), gem5::bloom_filter::Base::isSet(), gem5::bloom_filter::Base::merge(), and TestFilter::set().
| TEST | ( | BloomFilterBaseTest | , |
| MergeNoIntersection | ) |
Test merging two filters with intersecting entries.
The caller is modified, but the other filter is not.
Definition at line 275 of file base.test.cc.
References GEM5_DECLARE_FILTER_PARAMS, gem5::bloom_filter::Base::getTotalCount(), gem5::bloom_filter::Base::isSet(), gem5::bloom_filter::Base::merge(), and TestFilter::set().
| TEST | ( | BloomFilterBaseTest | , |
| MergeWithEmpty | ) |
Test that merging a populated filter with an empty filter does not modify any of the filters.
Definition at line 238 of file base.test.cc.
References GEM5_DECLARE_FILTER_PARAMS, gem5::bloom_filter::Base::getTotalCount(), gem5::bloom_filter::Base::isSet(), gem5::bloom_filter::Base::merge(), and TestFilter::set().
| TEST | ( | BloomFilterBaseTest | , |
| MergeWithEmpty2 | ) |
Test that merging an empty filter with a populated filter results in two equal filters.
Definition at line 256 of file base.test.cc.
References GEM5_DECLARE_FILTER_PARAMS, gem5::bloom_filter::Base::getTotalCount(), gem5::bloom_filter::Base::isSet(), gem5::bloom_filter::Base::merge(), and TestFilter::set().
| TEST | ( | BloomFilterBaseTest | , |
| MultipleIsSet | ) |
Test that isSet works for multiple simultaneously set entries by simultaneously saturating different entries at the same time.
Definition at line 115 of file base.test.cc.
References gem5::bloom_filter::Base::clear(), GEM5_DECLARE_FILTER_PARAMS, gem5::bloom_filter::Base::getTotalCount(), gem5::bloom_filter::Base::isSet(), and TestFilter::set().
| TEST | ( | BloomFilterBaseTest | , |
| SingleIsSet | ) |
Test that setting a single entry when the threshold is 1 will only set that entry, and no other entry.
Definition at line 82 of file base.test.cc.
References gem5::bloom_filter::Base::clear(), GEM5_DECLARE_FILTER_PARAMS, gem5::bloom_filter::Base::getTotalCount(), gem5::bloom_filter::Base::isSet(), and TestFilter::set().
| TEST | ( | BloomFilterBaseTest | , |
| SingleIsSetThreshold | ) |
Test that isSet takes the threshold into consideration.
This test increases the number of bits in the filter's entries to be able to raise the threshold at which an entry is considered as set.
Definition at line 167 of file base.test.cc.
References gem5::bloom_filter::Base::clear(), GEM5_DECLARE_FILTER_PARAMS, gem5::bloom_filter::Base::getTotalCount(), gem5::bloom_filter::Base::isSet(), and TestFilter::set().