1 /* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
17 #include <type_traits>
21 #include <xbt/config.h>
22 #include <xbt/config.hpp>
24 #include "xbt/sysdep.h"
27 #include "xbt/dynar.h"
32 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_cfg, xbt, "configuration support");
34 XBT_EXPORT_NO_IMPORT(xbt_cfg_t) simgrid_config = nullptr;
36 XBT_PUBLIC(void) sg_config_finalize();
42 missing_key_error::~missing_key_error() = default;
48 const char* true_values[] = {
49 "yes", "on", "true", "1"
51 const char* false_values[] = {
52 "no", "off", "false", "0"
55 static bool parseBool(const char* value)
57 for (const char* true_value : true_values)
58 if (std::strcmp(true_value, value) == 0)
60 for (const char* false_value : false_values)
61 if (std::strcmp(false_value, value) == 0)
63 throw std::range_error("not a boolean");
66 static double parseDouble(const char* value)
70 double res = std::strtod(value, &end);
72 throw std::range_error("out of range");
74 xbt_die("Unexpected errno");
75 if (end == value || *end != '\0')
76 throw std::range_error("invalid double");
81 static long int parseLong(const char* value)
85 long int res = std::strtol(value, &end, 0);
87 if (res == LONG_MIN && errno == ERANGE)
88 throw std::range_error("underflow");
89 else if (res == LONG_MAX && errno == ERANGE)
90 throw std::range_error("overflow");
91 xbt_die("Unexpected errno");
93 if (end == value || *end != '\0')
94 throw std::range_error("invalid integer");
99 // ***** ConfigType *****
101 /// A trait which define possible options types:
102 template<class T> struct ConfigType;
104 template<> struct ConfigType<int> {
105 static constexpr const char* type_name = "int";
106 static inline double parse(const char* value)
108 return parseLong(value);
111 template<> struct ConfigType<double> {
112 static constexpr const char* type_name = "double";
113 static inline double parse(const char* value)
115 return parseDouble(value);
118 template<> struct ConfigType<std::string> {
119 static constexpr const char* type_name = "string";
120 static inline std::string parse(const char* value)
122 return std::string(value);
125 template<> struct ConfigType<bool> {
126 static constexpr const char* type_name = "boolean";
127 static inline bool parse(const char* value)
129 return parseBool(value);
133 // **** Forward declarations ****
135 class ConfigurationElement ;
136 template<class T> class TypedConfigurationElement;
138 // **** ConfigurationElement ****
140 class ConfigurationElement {
144 bool isdefault = true;
149 xbt_cfg_cb_t old_callback = nullptr;
151 ConfigurationElement(const char* key, const char* desc)
152 : key(key ? key : ""), desc(desc ? desc : "") {}
153 ConfigurationElement(const char* key, const char* desc, xbt_cfg_cb_t cb)
154 : key(key ? key : ""), desc(desc ? desc : ""), old_callback(cb) {}
156 virtual ~ConfigurationElement()=default;
158 virtual std::string getStringValue() = 0;
159 virtual void setStringValue(const char* value) = 0;
160 virtual const char* getTypeName() = 0;
163 T const& getValue() const
165 return dynamic_cast<const TypedConfigurationElement<T>&>(*this).getValue();
168 void setValue(T value)
170 dynamic_cast<TypedConfigurationElement<T>&>(*this).setValue(std::move(value));
173 void setDefaultValue(T value)
175 dynamic_cast<TypedConfigurationElement<T>&>(*this).setDefaultValue(std::move(value));
177 bool isDefault() const { return isdefault; }
179 std::string const& getDescription() const { return desc; }
182 // **** TypedConfigurationElement<T> ****
184 // TODO, could we use boost::any with some Type* reference?
186 class TypedConfigurationElement : public ConfigurationElement {
189 std::function<void(T&)> callback;
192 TypedConfigurationElement(const char* key, const char* desc, T value = T())
193 : ConfigurationElement(key, desc), content(std::move(value))
195 TypedConfigurationElement(const char* key, const char* desc, T value,
197 : ConfigurationElement(key, desc, cb), content(std::move(value))
199 TypedConfigurationElement(const char* key, const char* desc, T value,
200 std::function<void(T&)> callback)
201 : ConfigurationElement(key, desc), content(std::move(value)),
202 callback(std::move(callback))
204 ~TypedConfigurationElement()=default;
206 std::string getStringValue() override;
207 const char* getTypeName() override;
208 void setStringValue(const char* value) override;
213 this->old_callback(key.c_str());
215 this->callback(this->content);
218 T const& getValue() const { return content; }
220 void setValue(T value)
222 this->content = std::move(value);
226 void setDefaultValue(T value)
228 if (this->isdefault) {
229 this->content = std::move(value);
232 XBT_DEBUG("Do not override configuration variable '%s' with value '%s'"
233 " because it was already set.", key.c_str(), to_string(value).c_str());
239 std::string TypedConfigurationElement<T>::getStringValue() // override
241 return to_string(content);
245 void TypedConfigurationElement<T>::setStringValue(const char* value) // override
247 this->content = ConfigType<T>::parse(value);
248 this->isdefault = false;
253 const char* TypedConfigurationElement<T>::getTypeName() // override
255 return ConfigType<T>::type_name;
258 } // end of anonymous namespace
264 // name -> ConfigElement:
266 // alias -> xbt_dict_elm_t from options:
268 bool warn_for_aliases;
275 Config(Config const&) = delete;
276 Config& operator=(Config const&) = delete;
278 ConfigurationElement& operator[](const char* name);
280 TypedConfigurationElement<T>& getTyped(const char* name);
281 void alias(const char* realname, const char* aliasname);
283 template<class T, class... A>
284 simgrid::config::TypedConfigurationElement<T>*
285 registerOption(const char* name, A&&... a)
287 xbt_assert(xbt_dict_get_or_null(this->options, name) == nullptr,
288 "Refusing to register the config element '%s' twice.", name);
289 TypedConfigurationElement<T>* variable =
290 new TypedConfigurationElement<T>(name, std::forward<A>(a)...);
291 XBT_DEBUG("Register cfg elm %s (%s) of type %s @%p in set %p)",
293 variable->getDescription().c_str(),
294 variable->getTypeName(), variable, this);
295 xbt_dict_set(this->options, name, variable, nullptr);
301 void dump(const char *name, const char *indent);
306 xbt_dictelm_t getDictElement(const char* name);
309 /* Internal stuff used in cache to free a variable */
310 static void xbt_cfgelm_free(void *data)
313 delete (simgrid::config::ConfigurationElement*) data;
317 : options(xbt_dict_new_homogeneous(xbt_cfgelm_free))
318 , aliases(xbt_dict_new_homogeneous(nullptr))
319 , warn_for_aliases(true)
324 XBT_DEBUG("Frees cfg set %p", this);
325 xbt_dict_free(&this->options);
326 xbt_dict_free(&this->aliases);
330 xbt_dictelm_t Config::getDictElement(const char* name)
332 // We are interested in the options dictelm:
333 xbt_dictelm_t res = xbt_dict_get_elm_or_null(options, name);
336 // The aliases dict stores pointers to the options dictelm:
337 res = (xbt_dictelm_t) xbt_dict_get_or_null(aliases, name);
338 if (res && warn_for_aliases)
339 XBT_INFO("Option %s has been renamed to %s. Consider switching.", name, res->key);
344 ConfigurationElement& Config::operator[](const char* name)
346 xbt_dictelm_t elm = getDictElement(name);
348 throw simgrid::config::missing_key_error(std::string("Bad config key, ") + name);
349 return *(ConfigurationElement*)elm->content;
352 void Config::alias(const char* realname, const char* aliasname)
354 xbt_assert(this->getDictElement(aliasname) == nullptr, "Alias '%s' already.", aliasname);
355 xbt_dictelm_t element = this->getDictElement(realname);
356 xbt_assert(element, "Cannot define an alias to the non-existing option '%s'.", realname);
357 xbt_dict_set(this->aliases, aliasname, element, nullptr);
360 /** @brief Dump a config set for debuging purpose
362 * @param name The name to give to this config set
363 * @param indent what to write at the beginning of each line (right number of spaces)
365 void Config::dump(const char *name, const char *indent)
367 xbt_dict_t dict = this->options;
368 xbt_dict_cursor_t cursor = nullptr;
369 simgrid::config::ConfigurationElement* variable = nullptr;
373 printf("%s>> Dumping of the config set '%s':\n", indent, name);
375 xbt_dict_foreach(dict, cursor, key, variable)
376 printf("%s %s: ()%s) %s", indent, key,
377 variable->getTypeName(),
378 variable->getStringValue().c_str());
381 printf("%s<< End of the config set '%s'\n", indent, name);
384 xbt_dict_cursor_free(&cursor);
387 /** @brief Displays the declared aliases and their description */
388 void Config::showAliases()
390 xbt_dict_cursor_t dict_cursor;
391 xbt_dictelm_t dictel;
393 std::vector<char*> names;
395 xbt_dict_foreach(this->aliases, dict_cursor, name, dictel)
396 names.push_back(name);
397 std::sort(begin(names), end(names), [](char* a, char* b) { return strcmp(a, b) < 0; });
399 bool old_warn_for_aliases = false;
400 std::swap(warn_for_aliases, old_warn_for_aliases);
401 for (auto name : names)
402 printf(" %s: %s\n", name, (*this)[name].getDescription().c_str());
403 std::swap(warn_for_aliases, old_warn_for_aliases);
406 /** @brief Displays the declared options and their description */
409 xbt_dict_cursor_t dict_cursor;
410 simgrid::config::ConfigurationElement* variable;
412 std::vector<char*> names;
414 xbt_dict_foreach(this->options, dict_cursor, name, variable)
415 names.push_back(name);
416 std::sort(begin(names), end(names), [](char* a, char* b) { return strcmp(a, b) < 0; });
418 for (auto name : names) {
419 variable = (simgrid::config::ConfigurationElement*) xbt_dict_get(this->options, name);
420 printf(" %s: %s\n", name, variable->getDescription().c_str());
421 printf(" Type: %s; ", variable->getTypeName());
422 printf("Current value: %s\n", variable->getStringValue().c_str());
426 // ***** getConfig *****
429 XBT_PUBLIC(T const&) getConfig(const char* name)
431 return (*simgrid_config)[name].getValue<T>();
434 template XBT_PUBLIC(int const&) getConfig<int>(const char* name);
435 template XBT_PUBLIC(double const&) getConfig<double>(const char* name);
436 template XBT_PUBLIC(bool const&) getConfig<bool>(const char* name);
437 template XBT_PUBLIC(std::string const&) getConfig<std::string>(const char* name);
441 void alias(const char* realname, const char* aliasname)
443 simgrid_config->alias(realname, aliasname);
446 // ***** declareFlag *****
449 XBT_PUBLIC(void) declareFlag(const char* name, const char* description,
450 T value, std::function<void(const T&)> callback)
452 if (simgrid_config == nullptr) {
453 simgrid_config = xbt_cfg_new();
454 atexit(sg_config_finalize);
456 simgrid_config->registerOption<T>(
457 name, description, std::move(value), std::move(callback));
460 template XBT_PUBLIC(void) declareFlag(const char* name,
461 const char* description, int value, std::function<void(int const &)> callback);
462 template XBT_PUBLIC(void) declareFlag(const char* name,
463 const char* description, double value, std::function<void(double const &)> callback);
464 template XBT_PUBLIC(void) declareFlag(const char* name,
465 const char* description, bool value, std::function<void(bool const &)> callback);
466 template XBT_PUBLIC(void) declareFlag(const char* name,
467 const char* description, std::string value, std::function<void(std::string const &)> callback);
472 // ***** C bindings *****
474 xbt_cfg_t xbt_cfg_new() { return new simgrid::config::Config(); }
475 void xbt_cfg_free(xbt_cfg_t * cfg) { delete *cfg; }
477 void xbt_cfg_dump(const char *name, const char *indent, xbt_cfg_t cfg)
479 cfg->dump(name, indent);
482 /*----[ Registering stuff ]-----------------------------------------------*/
484 void xbt_cfg_register_double(const char *name, double default_value,
485 xbt_cfg_cb_t cb_set, const char *desc)
487 if (simgrid_config == nullptr)
488 simgrid_config = xbt_cfg_new();
489 simgrid_config->registerOption<double>(name, desc, default_value, cb_set);
492 void xbt_cfg_register_int(const char *name, int default_value,xbt_cfg_cb_t cb_set, const char *desc)
494 if (simgrid_config == nullptr) {
495 simgrid_config = xbt_cfg_new();
496 atexit(&sg_config_finalize);
498 simgrid_config->registerOption<int>(name, desc, default_value, cb_set);
501 void xbt_cfg_register_string(const char *name, const char *default_value, xbt_cfg_cb_t cb_set, const char *desc)
503 if (simgrid_config == nullptr) {
504 simgrid_config = xbt_cfg_new();
505 atexit(sg_config_finalize);
507 simgrid_config->registerOption<std::string>(name, desc,
508 default_value ? default_value : "", cb_set);
511 void xbt_cfg_register_boolean(const char *name, const char*default_value,xbt_cfg_cb_t cb_set, const char *desc)
513 if (simgrid_config == nullptr) {
514 simgrid_config = xbt_cfg_new();
515 atexit(sg_config_finalize);
517 simgrid_config->registerOption<bool>(name, desc, simgrid::config::parseBool(default_value), cb_set);
520 void xbt_cfg_register_alias(const char *realname, const char *aliasname)
522 if (simgrid_config == nullptr) {
523 simgrid_config = xbt_cfg_new();
524 atexit(sg_config_finalize);
526 simgrid_config->alias(realname, aliasname);
529 void xbt_cfg_aliases() { simgrid_config->showAliases(); }
530 void xbt_cfg_help() { simgrid_config->help(); }
532 /*----[ Setting ]---------------------------------------------------------*/
534 /** @brief Add values parsed from a string into a config set
536 * @param options a string containing the content to add to the config set. This is a '\\t',' ' or '\\n' or ','
537 * separated list of variables. Each individual variable is like "[name]:[value]" where [name] is the name of an
538 * already registered variable, and [value] conforms to the data type under which this variable was registered.
540 * @todo This is a crude manual parser, it should be a proper lexer.
542 void xbt_cfg_set_parse(const char *options)
544 if (not options || not strlen(options)) { /* nothing to do */
547 char *optionlist_cpy = xbt_strdup(options);
549 XBT_DEBUG("List to parse and set:'%s'", options);
550 char *option = optionlist_cpy;
551 while (1) { /* breaks in the code */
555 int len = strlen(name);
556 XBT_DEBUG("Still to parse and set: '%s'. len=%d; option-name=%ld", name, len, (long) (option - name));
559 while (option - name <= (len - 1) && *option != ' ' && *option != '\n' && *option != '\t' && *option != ',') {
560 XBT_DEBUG("Take %c.", *option);
563 if (option - name == len) {
564 XBT_DEBUG("Boundary=EOL");
565 option = nullptr; /* don't do next iteration */
567 XBT_DEBUG("Boundary on '%c'. len=%d;option-name=%ld", *option, len, (long) (option - name));
568 /* Pass the following blank chars */
570 while (option - name < (len - 1) && (*option == ' ' || *option == '\n' || *option == '\t')) {
571 /* fprintf(stderr,"Ignore a blank char.\n"); */
574 if (option - name == len - 1)
575 option = nullptr; /* don't do next iteration */
577 XBT_DEBUG("parse now:'%s'; parse later:'%s'", name, option);
579 if (name[0] == ' ' || name[0] == '\n' || name[0] == '\t')
581 if (not strlen(name))
584 char *val = strchr(name, ':');
585 xbt_assert(val, "Option '%s' badly formatted. Should be of the form 'name:value'", name);
586 /* don't free(optionlist_cpy) if the assert fails, 'name' points inside it */
589 if (strncmp(name, "path", strlen("path")))
590 XBT_INFO("Configuration change: Set '%s' to '%s'", name, val);
593 (*simgrid_config)[name].setStringValue(val);
595 catch (simgrid::config::missing_key_error& e) {
603 free(optionlist_cpy);
606 /* Do not THROWF from a C++ exception catching context, or some cleanups will be missing */
608 free(optionlist_cpy);
609 THROWF(not_found_error, 0, "Could not set variables %s", options);
612 free(optionlist_cpy);
613 THROWF(unknown_error, 0, "Could not set variables %s", options);
616 // Horrible mess to translate C++ exceptions to C exceptions:
617 // Exit from the catch blog (and do the correct exceptio cleaning)
618 // before attempting to THROWF.
619 #define TRANSLATE_EXCEPTIONS(...) \
620 catch(simgrid::config::missing_key_error& e) { THROWF(not_found_error, 0, __VA_ARGS__); abort(); } \
621 catch(...) { THROWF(not_found_error, 0, __VA_ARGS__); abort(); }
623 /** @brief Set the value of a variable, using the string representation of that value
625 * @param key name of the variable to modify
626 * @param value string representation of the value to set
629 void xbt_cfg_set_as_string(const char *key, const char *value)
632 (*simgrid_config)[key].setStringValue(value);
635 TRANSLATE_EXCEPTIONS("Could not set variable %s as string %s", key, value);
638 /** @brief Set an integer value to \a name within \a cfg if it wasn't changed yet
640 * This is useful to change the default value of a variable while allowing
641 * users to override it with command line arguments
643 void xbt_cfg_setdefault_int(const char *key, int value)
646 (*simgrid_config)[key].setDefaultValue<int>(value);
649 TRANSLATE_EXCEPTIONS("Could not set variable %s to default integer %i",
653 /** @brief Set an integer value to \a name within \a cfg if it wasn't changed yet
655 * This is useful to change the default value of a variable while allowing
656 * users to override it with command line arguments
658 void xbt_cfg_setdefault_double(const char *key, double value)
661 (*simgrid_config)[key].setDefaultValue<double>(value);
664 TRANSLATE_EXCEPTIONS("Could not set variable %s to default double %f",
668 /** @brief Set a string value to \a name within \a cfg if it wasn't changed yet
670 * This is useful to change the default value of a variable while allowing
671 * users to override it with command line arguments
673 void xbt_cfg_setdefault_string(const char *key, const char *value)
676 (*simgrid_config)[key].setDefaultValue<std::string>(value ? value : "");
679 TRANSLATE_EXCEPTIONS("Could not set variable %s to default string %s",
683 /** @brief Set an boolean value to \a name within \a cfg if it wasn't changed yet
685 * This is useful to change the default value of a variable while allowing
686 * users to override it with command line arguments
688 void xbt_cfg_setdefault_boolean(const char *key, const char *value)
691 (*simgrid_config)[key].setDefaultValue<bool>(simgrid::config::parseBool(value));
694 TRANSLATE_EXCEPTIONS("Could not set variable %s to default boolean %s",
698 /** @brief Set an integer value to \a name within \a cfg
700 * @param key the name of the variable
701 * @param value the value of the variable
703 void xbt_cfg_set_int(const char *key, int value)
706 (*simgrid_config)[key].setValue<int>(value);
709 TRANSLATE_EXCEPTIONS("Could not set variable %s to integer %i",
713 /** @brief Set or add a double value to \a name within \a cfg
715 * @param key the name of the variable
716 * @param value the double to set
718 void xbt_cfg_set_double(const char *key, double value)
721 (*simgrid_config)[key].setValue<double>(value);
724 TRANSLATE_EXCEPTIONS("Could not set variable %s to double %f",
728 /** @brief Set or add a string value to \a name within \a cfg
730 * @param key the name of the variable
731 * @param value the value to be added
734 void xbt_cfg_set_string(const char *key, const char *value)
737 (*simgrid_config)[key].setValue<std::string>(value ? value : "");
740 TRANSLATE_EXCEPTIONS("Could not set variable %s to string %s",
744 /** @brief Set or add a boolean value to \a name within \a cfg
746 * @param key the name of the variable
747 * @param value the value of the variable
749 void xbt_cfg_set_boolean(const char *key, const char *value)
752 (*simgrid_config)[key].setValue<bool>(simgrid::config::parseBool(value));
755 TRANSLATE_EXCEPTIONS("Could not set variable %s to boolean %s",
760 /* Say if the value is the default value */
761 int xbt_cfg_is_default_value(const char *key)
764 return (*simgrid_config)[key].isDefault() ? 1 : 0;
766 TRANSLATE_EXCEPTIONS("Could not get variable %s", key);
769 /*----[ Getting ]---------------------------------------------------------*/
770 /** @brief Retrieve an integer value of a variable (get a warning if not uniq)
772 * @param key the name of the variable
774 * Returns the first value from the config set under the given name.
776 int xbt_cfg_get_int(const char *key)
779 return (*simgrid_config)[key].getValue<int>();
781 TRANSLATE_EXCEPTIONS("Could not get variable %s", key);
784 /** @brief Retrieve a double value of a variable (get a warning if not uniq)
786 * @param key the name of the variable
788 * Returns the first value from the config set under the given name.
790 double xbt_cfg_get_double(const char *key)
793 return (*simgrid_config)[key].getValue<double>();
795 TRANSLATE_EXCEPTIONS("Could not get variable %s", key);
798 /** @brief Retrieve a string value of a variable (get a warning if not uniq)
800 * @param key the name of the variable
802 * Returns the first value from the config set under the given name.
803 * If there is more than one value, it will issue a warning.
804 * Returns nullptr if there is no value.
806 * \warning the returned value is the actual content of the config set
808 char *xbt_cfg_get_string(const char *key)
811 return (char*) (*simgrid_config)[key].getValue<std::string>().c_str();
813 TRANSLATE_EXCEPTIONS("Could not get variable %s", key);
816 /** @brief Retrieve a boolean value of a variable (get a warning if not uniq)
818 * @param key the name of the variable
820 * Returns the first value from the config set under the given name.
821 * If there is more than one value, it will issue a warning.
823 int xbt_cfg_get_boolean(const char *key)
826 return (*simgrid_config)[key].getValue<bool>() ? 1 : 0;
828 TRANSLATE_EXCEPTIONS("Could not get variable %s", key);
837 #include <xbt/ex.hpp>
839 #include <xbt/config.hpp>
841 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_cfg);
843 XBT_TEST_SUITE("config", "Configuration support");
845 XBT_PUBLIC_DATA(xbt_cfg_t) simgrid_config;
847 static void make_set()
849 simgrid_config = nullptr;
850 xbt_log_threshold_set(&_XBT_LOGV(xbt_cfg), xbt_log_priority_critical);
851 xbt_cfg_register_int("speed", 0, nullptr, "");
852 xbt_cfg_register_string("peername", "", nullptr, "");
853 xbt_cfg_register_string("user", "", nullptr, "");
854 } /* end_of_make_set */
856 XBT_TEST_UNIT("memuse", test_config_memuse, "Alloc and free a config set")
858 auto temp = simgrid_config;
860 xbt_test_add("Alloc and free a config set");
861 xbt_cfg_set_parse("peername:veloce user:bidule");
862 xbt_cfg_free(&simgrid_config);
863 simgrid_config = temp;
866 XBT_TEST_UNIT("use", test_config_use, "Data retrieving tests")
868 auto temp = simgrid_config;
870 xbt_test_add("Get a single value");
872 /* get_single_value */
875 xbt_cfg_set_parse("peername:toto:42 speed:42");
876 ival = xbt_cfg_get_int("speed");
878 xbt_test_fail("Speed value = %d, I expected 42", ival);
881 xbt_test_add("Access to a non-existant entry");
884 xbt_cfg_set_parse("color:blue");
886 if (e.category != not_found_error)
887 xbt_test_exception(e);
890 xbt_cfg_free(&simgrid_config);
891 simgrid_config = temp;
894 XBT_TEST_UNIT("c++flags", test_config_cxx_flags, "C++ flags")
896 auto temp = simgrid_config;
898 xbt_test_add("C++ declaration of flags");
900 simgrid::config::Flag<int> int_flag("int", "", 0);
901 simgrid::config::Flag<std::string> string_flag("string", "", "foo");
902 simgrid::config::Flag<double> double_flag("double", "", 0.32);
903 simgrid::config::Flag<bool> bool_flag1("bool1", "", false);
904 simgrid::config::Flag<bool> bool_flag2("bool2", "", true);
906 xbt_test_add("Parse values");
907 xbt_cfg_set_parse("int:42 string:bar double:8.0 bool1:true bool2:false");
908 xbt_test_assert(int_flag == 42, "Check int flag");
909 xbt_test_assert(string_flag == "bar", "Check string flag");
910 xbt_test_assert(double_flag == 8.0, "Check double flag");
911 xbt_test_assert(bool_flag1, "Check bool1 flag");
912 xbt_test_assert(not bool_flag2, "Check bool2 flag");
914 xbt_cfg_free(&simgrid_config);
915 simgrid_config = temp;
918 #endif /* SIMGRID_TEST */