src/mem/cache/tags/dueling.test.cc
/**
 * Test whether entry initialization creates exactly the amount of samples
 * requested.
 */
Test whether entry initialization creates exactly the amount of samples
requested.
Test whether entry initialization creates exactly the amount of samples requested .
TEST_P(DuelingMonitorTest, CountSamples)
{
    const int expected_num_samples =
        (entries.size() / constituencySize) * teamSize;
    int count_samples_true = 0;
    int count_samples_false = 0;
    bool team;
    for (auto& entry : entries) {
        if (entry.isSample(1ULL << monitor_id, team)) {
            if (team) {
                count_samples_true++;
            } else {
                count_samples_false++;
            }
        }
    }
    ASSERT_EQ(count_samples_true, count_samples_false);
    ASSERT_EQ(count_samples_true, expected_num_samples);
}
TEST_P ( DuelingMonitorTest , CountSamples ) { const int expected_num_samples = ( entries . size ( ) / constituencySize ) * teamSize ; int count_samples_true = 0 ; int count_samples_false = 0 ; bool team ; for ( auto & entry : entries ) { if ( entry . isSample ( 1ULL << monitor_id , team ) ) { if ( team ) { count_samples_true ++ ; } else { count_samples_false ++ ; } } } ASSERT_EQ ( count_samples_true , count_samples_false ) ; ASSERT_EQ ( count_samples_true , expected_num_samples ) ; }
Test whether entry initialization creates exactly the amount of samples
 requested.
Test whether entry initialization creates exactly the amount of samples requested .
// Check whether the number of samples match expectation. // Both teams must also have the same number of samples