Commit 6dbf224e authored by Ben Huber's avatar Ben Huber

Defining multiple UnitTests with the same name does not crash the execution of 'make test' anymore

parent 8b1c1fe7
Pipeline #1351 passed with stages
in 17 minutes and 32 seconds
......@@ -11,7 +11,7 @@ Potentially breaking changes are marked with an exclamation point '!' at the beg
* ! Support for GCC <= 4.8 was dropped. Update your compiler if this affects you.
* (optional) support for arpack https://github.com/opencollab/arpack-ng
* Fixed minor rank reduction bug in TensorNetwork soft thresholding.
* Defining multiple UnitTests with the same name does not crash the execution of 'make test' anymore.
* 2017-05-31 v3.0.1
* Added TTNetwork::use_dense_representations() to convert all components to dense representation.
......
......@@ -52,7 +52,10 @@ namespace xerus { namespace misc {
tests = new std::map<std::string, std::map<std::string, std::function<void()>>>();
}
if (tests->count(_group) > 0 && (*tests)[_group].count(_name) > 0) {
LOG(error, "Unit test '" << _group << "::" << _name << "' defined multiple times!");
std::cerr << "ERROR: Unit test '" << _group << ":" << _name << "' defined multiple times!" << std::endl;
while ((*tests)[_group].count(_name) > 0) {
_name += "_";
}
}
(*tests)[_group][_name] = _f;
}
......
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