Commit 816de0ac authored by Lukas Weber's avatar Lukas Weber

reenable checking for illegal observable names (containing / and .)

parent 3e3ecf0c
......@@ -54,8 +54,9 @@ private:
template<class T>
void measurements::add(const std::string name, T value) {
if(observables_.count(name) == 0) {
observables_.emplace(name, observable{name, default_bin_size_, value_length(value)});
register_observable(name, default_bin_size_);
}
observables_.at(name).add(value);
}
}
t1 = executable('tests',
['duration_parser.cpp', 'monotone_interpolator.cpp'],
['duration_parser.cpp', 'monotone_interpolator.cpp', 'observable_names.cpp'],
dependencies : loadleveller_dep,
include_directories : include_directories('../src')
)
test('tests', t1)
subdir('silly_mc')
subdir('silly_mc')
#include "catch.hpp"
#include "measurements.h"
using namespace loadl;
TEST_CASE("illegal observable names") {
measurements meas(1);
CHECK_THROWS(meas.add("A/B.", 1));
CHECK_THROWS(meas.add("A/B", 1));
CHECK_THROWS(meas.add(".AB", 1));
CHECK_NOTHROW(meas.add("AB", 1));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment