Commit 6a28f1e9 by biojppm Committed by Dominic Hamon

Fixture: add non const Setup() and TearDown(). (#285)

* Fixture: add non const Setup() and TearDown(). This allows write-access to the State variable, which is important in upcoming user-defined counter functionality. * Fix const placement in the Fixture methods. * Fixture: use const_cast instead of static_cast.
parent 83561f05
...@@ -709,8 +709,12 @@ public: ...@@ -709,8 +709,12 @@ public:
this->TearDown(st); this->TearDown(st);
} }
// These will be deprecated ...
virtual void SetUp(const State&) {} virtual void SetUp(const State&) {}
virtual void TearDown(const State&) {} virtual void TearDown(const State&) {}
// ... In favor of these.
virtual void SetUp(State& st) { SetUp(const_cast<const State&>(st)); }
virtual void TearDown(State& st) { TearDown(const_cast<const State&>(st)); }
protected: protected:
virtual void BenchmarkCase(State&) = 0; virtual void BenchmarkCase(State&) = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment