[damage_tracker] Reset the tracker in the end() method so we can reuse it.

The *_check tools already reuse trackers.

Patch from Ming-Hung Tsai.
This commit is contained in:
Joe Thornber
2015-05-26 12:49:27 +01:00
parent 85d1701ba1
commit 880785a9bf
2 changed files with 20 additions and 2 deletions

View File

@@ -98,4 +98,15 @@ TEST_F(DamageTrackerTests, gi_bi_gi_bl_gl)
assert_damage(dt.good_leaf(15, 20), run64(10ull, 15ull));
}
TEST_F(DamageTrackerTests, end_resets_tracker)
{
dt.good_internal(0);
dt.good_leaf(0, 10);
dt.bad_node();
assert_damage(dt.end(), run64(10ull));
assert_no_damage(dt.good_leaf(20, 30));
assert_no_damage(dt.end());
}
//----------------------------------------------------------------