Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Sep 1, 2016
Merged

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

merged 3 commits into from
Sep 1, 2016

Conversation

biojppm
Copy link
Contributor

@biojppm biojppm commented Aug 31, 2016

This allows write-access to the State argument, which is important in upcoming user-defined counter functionality.

This allows write-access to the State variable, which is important in
upcoming user-defined counter functionality.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 87.669% when pulling b7b8c9a on biojppm:fixture into 61f570e on google:master.

@AppVeyorBot
Copy link

Build benchmark 403 completed (commit 593e40b416 by @jppm)

virtual void SetUp(const State&) {}
virtual void TearDown(const State&) {}
// ... In favor of these.
virtual void SetUp(State& st) { SetUp(static_cast<State const&>(st)); }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please be consistent wrt the placement of const. This library generally puts it before the type name. (I am in the "after the type name" camp, but consistency trumps.)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 87.73% when pulling b8d1424 on biojppm:fixture into 61f570e on google:master.

@AppVeyorBot
Copy link

Build benchmark 405 completed (commit 99e137a332 by @jppm)

virtual void SetUp(const State&) {}
virtual void TearDown(const State&) {}
// ... In favor of these.
virtual void SetUp(State& st) { SetUp(static_cast<const State&>(st)); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const_cast, probably.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah this should be static_cast. const_cast is for removing const.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gah, completely read it wrong. i thought it was the other way around (with the old ones forwarding to the new ones)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 87.669% when pulling 1f86241 on biojppm:fixture into 61f570e on google:master.

@AppVeyorBot
Copy link

Build benchmark 407 completed (commit 44c8fdda78 by @jppm)

@dmah42 dmah42 merged commit 6a28f1e into google:master Sep 1, 2016
@biojppm biojppm deleted the fixture branch March 1, 2017 23:40
FantasqueX added a commit to FantasqueX/benchmark that referenced this pull request Dec 28, 2023
dmah42 added a commit that referenced this pull request Jan 5, 2024
Const SetUp and TearDown were deprecated in #285

Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants