RUNNER_ASSERT_MSG(ifs, "Failed to open " << filename);
std::string line;
TestVector tv;
- while (std::getline(ifs, line))
- {
+ while (std::getline(ifs, line)) {
+ /* truncate blank chars from the beginning of the line */
+ size_t i;
+ for (i = 0; i < line.size(); ++i)
+ if (!isblank(line[i]))
+ break;
+ line = line.substr(i);
+
if (line.empty()) {
/* next test vector */
if (!tv.empty()) {
}
} else {
size_t equals = line.find('=');
+ bool comment = (line[0] == '#');
/* ignore lines without '=' */
- if (equals != std::string::npos)
- {
+ if (!comment && equals != std::string::npos) {
std::string key = line.substr(0, equals);
std::string value = line.substr(equals + 1);
tv.add(key, value);