mirror of
https://github.com/google/benchmark.git
synced 2025-03-27 04:27:12 +08:00
Check argument count in ArgName
and ArgNames
.
This commit is contained in:
parent
c1c01b2cd3
commit
cfee1a54e4
@ -306,11 +306,13 @@ Benchmark* Benchmark::Ranges(const std::vector<std::pair<int, int>>& ranges) {
|
||||
}
|
||||
|
||||
Benchmark* Benchmark::ArgName(const std::string& name) {
|
||||
CHECK(ArgsCnt() == -1 || ArgsCnt() == 1);
|
||||
arg_names_ = {name};
|
||||
return this;
|
||||
}
|
||||
|
||||
Benchmark* Benchmark::ArgNames(const std::vector<std::string>& names) {
|
||||
CHECK(ArgsCnt() == -1 || ArgsCnt() == static_cast<int>(names.size()));
|
||||
arg_names_ = names;
|
||||
return this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user