-int xbt_cfg_get_boolean(const char *key)
-{
- try {
- return (*simgrid_config)[key].getValue<bool>() ? 1 : 0;
- }
- TRANSLATE_EXCEPTIONS("Could not get variable %s", key);
-}
-
-#ifdef SIMGRID_TEST
-
-#include <string>
-
-#include "xbt.h"
-#include "xbt/ex.h"
-#include <xbt/ex.hpp>
-
-#include <xbt/config.hpp>
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_cfg);
-
-XBT_TEST_SUITE("config", "Configuration support");
-
-XBT_PUBLIC_DATA(xbt_cfg_t) simgrid_config;
-
-static void make_set()
-{
- simgrid_config = nullptr;
- xbt_log_threshold_set(&_XBT_LOGV(xbt_cfg), xbt_log_priority_critical);
- xbt_cfg_register_int("speed", 0, nullptr, "");
- xbt_cfg_register_string("peername", "", nullptr, "");
- xbt_cfg_register_string("user", "", nullptr, "");
-} /* end_of_make_set */
-
-XBT_TEST_UNIT("memuse", test_config_memuse, "Alloc and free a config set")
-{
- auto temp = simgrid_config;
- make_set();
- xbt_test_add("Alloc and free a config set");
- xbt_cfg_set_parse("peername:veloce user:bidule");
- xbt_cfg_free(&simgrid_config);
- simgrid_config = temp;
-}
-
-XBT_TEST_UNIT("use", test_config_use, "Data retrieving tests")