Skip to content

Commit b57b2cf

Browse files
committed
Improve some comments.
1 parent 64b5f3f commit b57b2cf

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

test/output_test.h

+5-8
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,15 @@ void RunOutputTests(int argc, char* argv[]);
7878
struct Results;
7979
typedef std::function< void(Results const&) > ResultsCheckFn;
8080

81-
// Add a function to check the (CSV) results of a benchmark. These
82-
// functions will be called only after the output was successfully
83-
// checked.
84-
// bm_name_pattern: a name or a regex which will be matched agains
85-
// all the benchmark names. Matching benchmarks
86-
// will be the subject of a call to fn
8781
size_t AddChecker(const char* bm_name_pattern, ResultsCheckFn fn);
8882

89-
// Class to hold the (CSV!) results of a benchmark.
83+
// Class holding the results of a benchmark.
9084
// It is passed in calls to checker functions.
9185
struct Results {
92-
std::string name; // the benchmark name
86+
87+
// the benchmark name
88+
std::string name;
89+
// the benchmark fields
9390
std::map< std::string, std::string > values;
9491

9592
Results(const std::string& n) : name(n) {}

test/output_test_helper.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,11 @@ void ResultsChecker::SetHeader_(const std::string& csv_header) {
247247
field_names = SplitCsv_(csv_header);
248248
}
249249

250-
// set the values for subscribed benchmarks, and silently ignore all others
250+
// set the values for a benchmark
251251
void ResultsChecker::SetValues_(const std::string& entry_csv_line) {
252+
if(entry_csv_line.empty()) return; // some lines are empty
252253
CHECK(!field_names.empty());
253254
auto vals = SplitCsv_(entry_csv_line);
254-
if(vals.empty()) return;
255255
CHECK_EQ(vals.size(), field_names.size());
256256
results.emplace_back(vals[0]); // vals[0] is the benchmark name
257257
auto &entry = results.back();

0 commit comments

Comments
 (0)