Skip to content
Snippets Groups Projects
Commit 9dfe9233 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Changed capitalization of Test and related classes to be more consistent with our general style

parent 436c5c0d
No related branches found
No related tags found
1 merge request!17Aggregate benchmark results
......@@ -41,7 +41,7 @@ int vm_mass(const std::string& config_name) {
// create our test definition
// test_tag
eic::util::test vm_mass_resolution_test{
eic::util::Test vm_mass_resolution_test{
{{"name",
fmt::format("{}_{}_{}_mass_resolution", test_tag, vm_name, decay_name)},
{"title",
......
......@@ -14,7 +14,7 @@
// Usage Example 1 (single test):
// ==============================
// 1. define our test
// eic::util::test test1{
// eic::util::Test test1{
// {{"name", "example_test"},
// {"title", "Example Test"},
// {"description", "This is an example of a test definition"},
......@@ -28,13 +28,13 @@
// Usage Example 2 (multiple tests):
// =================================
// 1. define our tests
// eic::util::test test1{
// eic::util::Test test1{
// {{"name", "example_test"},
// {"title", "Example Test"},
// {"description", "This is an example of a test definition"},
// {"quantity", "efficiency"},
// {"target", "1"}}};
// eic::util::test test2{
// eic::util::Test test2{
// {{"name", "another_test"},
// {"title", "Another example Test"},
// {"description", "This is a second example of a test definition"},
......@@ -49,8 +49,8 @@
// library
namespace eic::util {
struct test_definition_error : exception {
test_definition_error(std::string_view msg)
struct TestDefinitionError : exception {
TestDefinitionError(std::string_view msg)
: exception(msg, "test_definition_error") {}
};
......@@ -67,7 +67,7 @@ struct test_definition_error : exception {
// - value: Actual value of <quantity>
// - weight: Weight for this test (this is defaulted to 1.0 if not specified)
// - result: pass/fail/error
struct test {
struct Test {
test(nlohmann::json definition) : json{std::move(definition)} {
// initialize with error (as we don't have a value yet)
error();
......@@ -75,7 +75,7 @@ struct test {
for (const auto& field : {"name", "title", "description", "quantity",
"target", "value", "result"}) {
if (json.find(field) == json.end()) {
throw test_definition_error{
throw TestDefinitionError{
fmt::format("Error in test definition: field '{}' missing", field)};
}
}
......
......@@ -5,14 +5,14 @@
#include <string>
namespace eic::util {
class exception : public std::exception {
class Exception : public std::exception {
public:
exception(std::string_view msg, std::string_view type = "exception")
Exception(std::string_view msg, std::string_view type = "exception")
: msg_{msg}, type_{type} {}
virtual const char* what() const throw() { return msg_.c_str(); }
virtual const char* type() const throw() { return type_.c_str(); }
virtual ~exception() throw() {}
virtual ~Exception() throw() {}
private:
std::string msg_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment