1
0
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:
Marek Kurdej 2016-10-26 09:29:28 +02:00
parent c1c01b2cd3
commit cfee1a54e4

View File

@ -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;
}