From 6af7742c35ecdf2831908443ca0e04bf23317a96 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 11 Jan 2023 19:57:00 +0100 Subject: Rename Configuation struct to configuration and make get/has functions member functions. --- test/tools_test.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/tools_test.cc b/test/tools_test.cc index acd4219..8455ce6 100644 --- a/test/tools_test.cc +++ b/test/tools_test.cc @@ -87,16 +87,20 @@ std::string conf_host_cxx{}; std::string conf_build_cxx{}; } -namespace ctor { -const std::string& getConfiguration(const std::string& key, - const std::string& defval) +const ctor::configuration& ctor::get_configuration() { - if(key == cfg::host_cxx) + static ctor::configuration cfg; + return cfg; +} + +const std::string& ctor::configuration::get(const std::string& key, const std::string& defval) const +{ + if(key == ctor::cfg::host_cxx) { return conf_host_cxx; } - if(key == cfg::build_cxx) + if(key == ctor::cfg::build_cxx) { return conf_build_cxx; } @@ -106,7 +110,6 @@ const std::string& getConfiguration(const std::string& key, static std::string res{}; return res; } -} // namespace ctor:: class ToolsTest : public uUnit -- cgit v1.2.3