mirror of https://github.com/google/benchmark.git
use std::string for skip messages (#1571)
This commit is contained in:
parent
adb0d3d0bf
commit
060d762d61
|
@ -760,7 +760,7 @@ class BENCHMARK_EXPORT State {
|
|||
// the current scope immediately. If the function is called from within
|
||||
// the 'KeepRunning()' loop the current iteration will finish. It is the users
|
||||
// responsibility to exit the scope as needed.
|
||||
void SkipWithMessage(const char* msg);
|
||||
void SkipWithMessage(const std::string& msg);
|
||||
|
||||
// REQUIRES: 'SkipWithMessage(...)' or 'SkipWithError(...)' has not been
|
||||
// called previously by the current thread.
|
||||
|
@ -781,7 +781,7 @@ class BENCHMARK_EXPORT State {
|
|||
// the current scope immediately. If the function is called from within
|
||||
// the 'KeepRunning()' loop the current iteration will finish. It is the users
|
||||
// responsibility to exit the scope as needed.
|
||||
void SkipWithError(const char* msg);
|
||||
void SkipWithError(const std::string& msg);
|
||||
|
||||
// Returns true if 'SkipWithMessage(...)' or 'SkipWithError(...)' was called.
|
||||
bool skipped() const { return internal::NotSkipped != skipped_; }
|
||||
|
|
|
@ -236,8 +236,7 @@ void State::ResumeTiming() {
|
|||
}
|
||||
}
|
||||
|
||||
void State::SkipWithMessage(const char* msg) {
|
||||
BM_CHECK(msg);
|
||||
void State::SkipWithMessage(const std::string& msg) {
|
||||
skipped_ = internal::SkippedWithMessage;
|
||||
{
|
||||
MutexLock l(manager_->GetBenchmarkMutex());
|
||||
|
@ -250,8 +249,7 @@ void State::SkipWithMessage(const char* msg) {
|
|||
if (timer_->running()) timer_->StopTimer();
|
||||
}
|
||||
|
||||
void State::SkipWithError(const char* msg) {
|
||||
BM_CHECK(msg);
|
||||
void State::SkipWithError(const std::string& msg) {
|
||||
skipped_ = internal::SkippedWithError;
|
||||
{
|
||||
MutexLock l(manager_->GetBenchmarkMutex());
|
||||
|
|
Loading…
Reference in New Issue