1 /* Copyright (c) 2004-2014,2016. 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. */
16 #include <type_traits>
19 #include <xbt/config.h>
20 #include <xbt/config.hpp>
22 #include "xbt/sysdep.h"
25 #include "xbt/dynar.h"
30 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_cfg, xbt, "configuration support");
32 XBT_EXPORT_NO_IMPORT(xbt_cfg_t) simgrid_config = nullptr;
34 XBT_PUBLIC(void) sg_config_finalize();
40 missing_key_error::~missing_key_error() {}
46 const char* true_values[] = {
47 "yes", "on", "true", "1"
49 const char* false_values[] = {
50 "no", "off", "false", "0"
53 static bool parseBool(const char* value)
55 for (const char* true_value : true_values)
56 if (std::strcmp(true_value, value) == 0)
58 for (const char* false_value : false_values)
59 if (std::strcmp(false_value, value) == 0)
61 throw std::range_error("not a boolean");
64 static double parseDouble(const char* value)
68 double res = std::strtod(value, &end);
70 throw std::range_error("out of range");
72 xbt_die("Unexpected errno");
73 if (end == value || *end != '\0')
74 throw std::range_error("invalid double");
79 static long int parseLong(const char* value)
83 long int res = std::strtol(value, &end, 0);
85 if (res == LONG_MIN && errno == ERANGE)
86 throw std::range_error("underflow");
87 else if (res == LONG_MAX && errno == ERANGE)
88 throw std::range_error("overflow");
89 xbt_die("Unexpected errno");
91 if (end == value || *end != '\0')
92 throw std::range_error("invalid integer");
97 // ***** ConfigType *****
99 /// A trait which define possible options types:
100 template<class T> struct ConfigType;
102 template<> struct ConfigType<int> {
103 static constexpr const char* type_name = "int";
104 static inline double parse(const char* value)
106 return parseLong(value);
109 template<> struct ConfigType<double> {
110 static constexpr const char* type_name = "double";
111 static inline double parse(const char* value)
113 return parseDouble(value);
116 template<> struct ConfigType<std::string> {
117 static constexpr const char* type_name = "string";
118 static inline std::string parse(const char* value)
120 return std::string(value);
123 template<> struct ConfigType<bool> {
124 static constexpr const char* type_name = "boolean";
125 static inline bool parse(const char* value)
127 return parseBool(value);
131 // **** Forward declarations ****
133 class ConfigurationElement ;
134 template<class T> class TypedConfigurationElement;
136 // **** ConfigurationElement ****
138 class ConfigurationElement {
142 bool isdefault = true;
147 xbt_cfg_cb_t old_callback = nullptr;
149 ConfigurationElement(const char* key, const char* desc)
150 : key(key ? key : ""), desc(desc ? desc : "") {}
151 ConfigurationElement(const char* key, const char* desc, xbt_cfg_cb_t cb)
152 : key(key ? key : ""), desc(desc ? desc : ""), old_callback(cb) {}
154 virtual ~ConfigurationElement();
156 virtual std::string getStringValue() = 0;
157 virtual void setStringValue(const char* value) = 0;
158 virtual const char* getTypeName() = 0;
161 T const& getValue() const
163 return dynamic_cast<const TypedConfigurationElement<T>&>(*this).getValue();
166 void setValue(T value)
168 dynamic_cast<TypedConfigurationElement<T>&>(*this).setValue(std::move(value));
171 void setDefaultValue(T value)
173 dynamic_cast<TypedConfigurationElement<T>&>(*this).setDefaultValue(std::move(value));
175 bool isDefault() const { return isdefault; }
177 std::string const& getDescription() const { return desc; }
180 ConfigurationElement::~ConfigurationElement() {}
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() override;
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;
259 TypedConfigurationElement<T>::~TypedConfigurationElement()
262 } // end of anonymous namespace
268 // name -> ConfigElement:
270 // alias -> xbt_dict_elm_t from options:
278 Config(Config const&) = delete;
279 Config& operator=(Config const&) = delete;
281 ConfigurationElement& operator[](const char* name);
283 TypedConfigurationElement<T>& getTyped(const char* name);
284 void alias(const char* realname, const char* aliasname);
286 template<class T, class... A>
287 simgrid::config::TypedConfigurationElement<T>*
288 registerOption(const char* name, A&&... a)
290 xbt_assert(xbt_dict_get_or_null(this->options, name) == nullptr,
291 "Refusing to register the config element '%s' twice.", name);
292 TypedConfigurationElement<T>* variable =
293 new TypedConfigurationElement<T>(name, std::forward<A>(a)...);
294 XBT_DEBUG("Register cfg elm %s (%s) of type %s @%p in set %p)",
296 variable->getDescription().c_str(),
297 variable->getTypeName(), variable, this);
298 xbt_dict_set(this->options, name, variable, nullptr);
304 void dump(const char *name, const char *indent);
309 xbt_dictelm_t getDictElement(const char* name);
312 /* Internal stuff used in cache to free a variable */
313 static void xbt_cfgelm_free(void *data)
316 delete (simgrid::config::ConfigurationElement*) data;
320 options(xbt_dict_new_homogeneous(xbt_cfgelm_free)),
321 aliases(xbt_dict_new_homogeneous(nullptr))
326 XBT_DEBUG("Frees cfg set %p", this);
327 xbt_dict_free(&this->options);
328 xbt_dict_free(&this->aliases);
332 xbt_dictelm_t Config::getDictElement(const char* name)
334 // We are interested in the options dictelm:
335 xbt_dictelm_t res = xbt_dict_get_elm_or_null(options, name);
338 // The aliases dict stores pointers to the options dictelm:
339 res = (xbt_dictelm_t) xbt_dict_get_or_null(aliases, name);
341 XBT_INFO("Option %s has been renamed to %s. Consider switching.", name, res->key);
346 ConfigurationElement& Config::operator[](const char* name)
348 xbt_dictelm_t elm = getDictElement(name);
350 throw simgrid::config::missing_key_error(std::string("Bad config key, ") + name);
351 return *(ConfigurationElement*)elm->content;
354 void Config::alias(const char* realname, const char* aliasname)
356 xbt_assert(this->getDictElement(aliasname) == nullptr, "Alias '%s' already.", aliasname);
357 xbt_dictelm_t element = this->getDictElement(realname);
358 xbt_assert(element, "Cannot define an alias to the non-existing option '%s'.", realname);
359 xbt_dict_set(this->aliases, aliasname, element, nullptr);
362 /** @brief Dump a config set for debuging purpose
364 * @param name The name to give to this config set
365 * @param indent what to write at the beginning of each line (right number of spaces)
367 void Config::dump(const char *name, const char *indent)
369 xbt_dict_t dict = this->options;
370 xbt_dict_cursor_t cursor = nullptr;
371 simgrid::config::ConfigurationElement* variable = nullptr;
375 printf("%s>> Dumping of the config set '%s':\n", indent, name);
377 xbt_dict_foreach(dict, cursor, key, variable)
378 printf("%s %s: ()%s) %s", indent, key,
379 variable->getTypeName(),
380 variable->getStringValue().c_str());
383 printf("%s<< End of the config set '%s'\n", indent, name);
386 xbt_dict_cursor_free(&cursor);
389 /** @brief Displays the declared aliases and their description */
390 void Config::showAliases()
392 xbt_dict_cursor_t dict_cursor;
393 unsigned int dynar_cursor;
394 xbt_dictelm_t dictel;
396 xbt_dynar_t names = xbt_dynar_new(sizeof(char *), nullptr);
398 xbt_dict_foreach(this->aliases, dict_cursor, name, dictel)
399 xbt_dynar_push(names, &name);
400 xbt_dynar_sort_strings(names);
402 xbt_dynar_foreach(names, dynar_cursor, name)
403 printf(" %s: %s\n", name, (*this)[name].getDescription().c_str());
406 /** @brief Displays the declared options and their description */
409 xbt_dict_cursor_t dict_cursor;
410 unsigned int dynar_cursor;
411 simgrid::config::ConfigurationElement* variable;
413 xbt_dynar_t names = xbt_dynar_new(sizeof(char *), nullptr);
415 xbt_dict_foreach(this->options, dict_cursor, name, variable)
416 xbt_dynar_push(names, &name);
417 xbt_dynar_sort_strings(names);
419 xbt_dynar_foreach(names, dynar_cursor, name) {
420 variable = (simgrid::config::ConfigurationElement*) xbt_dict_get(this->options, name);
421 printf(" %s: %s\n", name, variable->getDescription().c_str());
422 printf(" Type: %s; ", variable->getTypeName());
423 printf("Current value: %s\n", variable->getStringValue().c_str());
425 xbt_dynar_free(&names);
428 // ***** getConfig *****
431 XBT_PUBLIC(T const&) getConfig(const char* name)
433 return (*simgrid_config)[name].getValue<T>();
436 template XBT_PUBLIC(int const&) getConfig<int>(const char* name);
437 template XBT_PUBLIC(double const&) getConfig<double>(const char* name);
438 template XBT_PUBLIC(bool const&) getConfig<bool>(const char* name);
439 template XBT_PUBLIC(std::string const&) getConfig<std::string>(const char* name);
443 void alias(const char* realname, const char* aliasname)
445 simgrid_config->alias(realname, aliasname);
448 // ***** declareFlag *****
451 XBT_PUBLIC(void) declareFlag(const char* name, const char* description,
452 T value, std::function<void(const T&)> callback)
454 if (simgrid_config == nullptr) {
455 simgrid_config = xbt_cfg_new();
456 atexit(sg_config_finalize);
458 simgrid_config->registerOption<T>(
459 name, description, std::move(value), std::move(callback));
462 template XBT_PUBLIC(void) declareFlag(const char* name,
463 const char* description, int value, std::function<void(int const &)> callback);
464 template XBT_PUBLIC(void) declareFlag(const char* name,
465 const char* description, double value, std::function<void(double const &)> callback);
466 template XBT_PUBLIC(void) declareFlag(const char* name,
467 const char* description, bool value, std::function<void(bool const &)> callback);
468 template XBT_PUBLIC(void) declareFlag(const char* name,
469 const char* description, std::string value, std::function<void(std::string const &)> callback);
474 // ***** C bindings *****
476 xbt_cfg_t xbt_cfg_new() { return new simgrid::config::Config(); }
477 void xbt_cfg_free(xbt_cfg_t * cfg) { delete *cfg; }
479 void xbt_cfg_dump(const char *name, const char *indent, xbt_cfg_t cfg)
481 cfg->dump(name, indent);
484 /*----[ Registering stuff ]-----------------------------------------------*/
486 void xbt_cfg_register_double(const char *name, double default_value,
487 xbt_cfg_cb_t cb_set, const char *desc)
489 if (simgrid_config == nullptr)
490 simgrid_config = xbt_cfg_new();
491 simgrid_config->registerOption<double>(name, desc, default_value, cb_set);
494 void xbt_cfg_register_int(const char *name, int default_value,xbt_cfg_cb_t cb_set, const char *desc)
496 if (simgrid_config == nullptr) {
497 simgrid_config = xbt_cfg_new();
498 atexit(&sg_config_finalize);
500 simgrid_config->registerOption<int>(name, desc, default_value, cb_set);
503 void xbt_cfg_register_string(const char *name, const char *default_value, xbt_cfg_cb_t cb_set, const char *desc)
505 if (simgrid_config == nullptr) {
506 simgrid_config = xbt_cfg_new();
507 atexit(sg_config_finalize);
509 simgrid_config->registerOption<std::string>(name, desc,
510 default_value ? default_value : "", cb_set);
513 void xbt_cfg_register_boolean(const char *name, const char*default_value,xbt_cfg_cb_t cb_set, const char *desc)
515 if (simgrid_config == nullptr) {
516 simgrid_config = xbt_cfg_new();
517 atexit(sg_config_finalize);
519 simgrid_config->registerOption<bool>(name, desc, simgrid::config::parseBool(default_value), cb_set);
522 void xbt_cfg_register_alias(const char *realname, const char *aliasname)
524 if (simgrid_config == nullptr) {
525 simgrid_config = xbt_cfg_new();
526 atexit(sg_config_finalize);
528 simgrid_config->alias(realname, aliasname);
531 void xbt_cfg_aliases() { simgrid_config->showAliases(); }
532 void xbt_cfg_help() { simgrid_config->help(); }
534 /*----[ Setting ]---------------------------------------------------------*/
536 /** @brief Add values parsed from a string into a config set
538 * @param options a string containing the content to add to the config set. This is a '\\t',' ' or '\\n' or ','
539 * separated list of variables. Each individual variable is like "[name]:[value]" where [name] is the name of an
540 * already registered variable, and [value] conforms to the data type under which this variable was registered.
542 * @todo This is a crude manual parser, it should be a proper lexer.
544 void xbt_cfg_set_parse(const char *options)
546 if (!options || !strlen(options)) { /* nothing to do */
549 char *optionlist_cpy = xbt_strdup(options);
551 XBT_DEBUG("List to parse and set:'%s'", options);
552 char *option = optionlist_cpy;
553 while (1) { /* breaks in the code */
557 int len = strlen(name);
558 XBT_DEBUG("Still to parse and set: '%s'. len=%d; option-name=%ld", name, len, (long) (option - name));
561 while (option - name <= (len - 1) && *option != ' ' && *option != '\n' && *option != '\t' && *option != ',') {
562 XBT_DEBUG("Take %c.", *option);
565 if (option - name == len) {
566 XBT_DEBUG("Boundary=EOL");
567 option = nullptr; /* don't do next iteration */
569 XBT_DEBUG("Boundary on '%c'. len=%d;option-name=%ld", *option, len, (long) (option - name));
570 /* Pass the following blank chars */
572 while (option - name < (len - 1) && (*option == ' ' || *option == '\n' || *option == '\t')) {
573 /* fprintf(stderr,"Ignore a blank char.\n"); */
576 if (option - name == len - 1)
577 option = nullptr; /* don't do next iteration */
579 XBT_DEBUG("parse now:'%s'; parse later:'%s'", name, option);
581 if (name[0] == ' ' || name[0] == '\n' || name[0] == '\t')
586 char *val = strchr(name, ':');
587 xbt_assert(val, "Option '%s' badly formatted. Should be of the form 'name:value'", name);
588 /* don't free(optionlist_cpy) if the assert fails, 'name' points inside it */
591 if (strncmp(name, "contexts/", strlen("contexts/")) && strncmp(name, "path", strlen("path")))
592 XBT_INFO("Configuration change: Set '%s' to '%s'", name, val);
595 (*simgrid_config)[name].setStringValue(val);
597 catch (simgrid::config::missing_key_error& e) {
605 free(optionlist_cpy);
609 free(optionlist_cpy);
610 THROWF(not_found_error, 0, "Could not set variables %s", options);
613 free(optionlist_cpy);
614 THROWF(unknown_error, 0, "Could not set variables %s", options);
617 // Horrible mess to translate C++ exceptions to C exceptions:
618 // Exit from the catch blog (and do the correct exceptio cleaning)
619 // before attempting to THROWF.
620 #define TRANSLATE_EXCEPTIONS(...) \
621 catch(simgrid::config::missing_key_error& e) { THROWF(not_found_error, 0, __VA_ARGS__); abort(); } \
622 catch(...) { THROWF(not_found_error, 0, __VA_ARGS__); abort(); }
624 /** @brief Set the value of a variable, using the string representation of that value
626 * @param key name of the variable to modify
627 * @param value string representation of the value to set
630 void xbt_cfg_set_as_string(const char *key, const char *value)
633 (*simgrid_config)[key].setStringValue(value);
636 TRANSLATE_EXCEPTIONS("Could not set variable %s as string %s", key, value);
639 /** @brief Set an integer value to \a name within \a cfg if it wasn't changed yet
641 * This is useful to change the default value of a variable while allowing
642 * users to override it with command line arguments
644 void xbt_cfg_setdefault_int(const char *key, int value)
647 (*simgrid_config)[key].setDefaultValue<int>(value);
650 TRANSLATE_EXCEPTIONS("Could not set variable %s to default integer %i",
654 /** @brief Set an integer value to \a name within \a cfg if it wasn't changed yet
656 * This is useful to change the default value of a variable while allowing
657 * users to override it with command line arguments
659 void xbt_cfg_setdefault_double(const char *key, double value)
662 (*simgrid_config)[key].setDefaultValue<double>(value);
665 TRANSLATE_EXCEPTIONS("Could not set variable %s to default double %f",
669 /** @brief Set a string value to \a name within \a cfg if it wasn't changed yet
671 * This is useful to change the default value of a variable while allowing
672 * users to override it with command line arguments
674 void xbt_cfg_setdefault_string(const char *key, const char *value)
677 (*simgrid_config)[key].setDefaultValue<std::string>(value ? value : "");
680 TRANSLATE_EXCEPTIONS("Could not set variable %s to default string %s",
684 /** @brief Set an boolean value to \a name within \a cfg if it wasn't changed yet
686 * This is useful to change the default value of a variable while allowing
687 * users to override it with command line arguments
689 void xbt_cfg_setdefault_boolean(const char *key, const char *value)
692 (*simgrid_config)[key].setDefaultValue<bool>(simgrid::config::parseBool(value));
695 TRANSLATE_EXCEPTIONS("Could not set variable %s to default boolean %s",
699 /** @brief Set an integer value to \a name within \a cfg
701 * @param key the name of the variable
702 * @param value the value of the variable
704 void xbt_cfg_set_int(const char *key, int value)
707 (*simgrid_config)[key].setValue<int>(value);
710 TRANSLATE_EXCEPTIONS("Could not set variable %s to integer %i",
714 /** @brief Set or add a double value to \a name within \a cfg
716 * @param key the name of the variable
717 * @param value the double to set
719 void xbt_cfg_set_double(const char *key, double value)
722 (*simgrid_config)[key].setValue<double>(value);
725 TRANSLATE_EXCEPTIONS("Could not set variable %s to double %f",
729 /** @brief Set or add a string value to \a name within \a cfg
731 * @param key the name of the variable
732 * @param value the value to be added
735 void xbt_cfg_set_string(const char *key, const char *value)
738 (*simgrid_config)[key].setValue<std::string>(value ? value : "");
741 TRANSLATE_EXCEPTIONS("Could not set variable %s to string %s",
745 /** @brief Set or add a boolean value to \a name within \a cfg
747 * @param key the name of the variable
748 * @param value the value of the variable
750 void xbt_cfg_set_boolean(const char *key, const char *value)
753 (*simgrid_config)[key].setValue<bool>(simgrid::config::parseBool(value));
756 TRANSLATE_EXCEPTIONS("Could not set variable %s to boolean %s",
761 /* Say if the value is the default value */
762 int xbt_cfg_is_default_value(const char *key)
765 return (*simgrid_config)[key].isDefault() ? 1 : 0;
767 TRANSLATE_EXCEPTIONS("Could not get variable %s", key);
770 /*----[ Getting ]---------------------------------------------------------*/
771 /** @brief Retrieve an integer value of a variable (get a warning if not uniq)
773 * @param key the name of the variable
775 * Returns the first value from the config set under the given name.
777 int xbt_cfg_get_int(const char *key)
780 return (*simgrid_config)[key].getValue<int>();
782 TRANSLATE_EXCEPTIONS("Could not get variable %s", key);
785 /** @brief Retrieve a double value of a variable (get a warning if not uniq)
787 * @param key the name of the variable
789 * Returns the first value from the config set under the given name.
791 double xbt_cfg_get_double(const char *key)
794 return (*simgrid_config)[key].getValue<double>();
796 TRANSLATE_EXCEPTIONS("Could not get variable %s", key);
799 /** @brief Retrieve a string value of a variable (get a warning if not uniq)
801 * @param key the name of the variable
803 * Returns the first value from the config set under the given name.
804 * If there is more than one value, it will issue a warning.
805 * Returns nullptr if there is no value.
807 * \warning the returned value is the actual content of the config set
809 char *xbt_cfg_get_string(const char *key)
812 return (char*) (*simgrid_config)[key].getValue<std::string>().c_str();
814 TRANSLATE_EXCEPTIONS("Could not get variable %s", key);
817 /** @brief Retrieve a boolean value of a variable (get a warning if not uniq)
819 * @param key the name of the variable
821 * Returns the first value from the config set under the given name.
822 * If there is more than one value, it will issue a warning.
824 int xbt_cfg_get_boolean(const char *key)
827 return (*simgrid_config)[key].getValue<bool>() ? 1 : 0;
829 TRANSLATE_EXCEPTIONS("Could not get variable %s", key);
838 #include <xbt/ex.hpp>
840 #include <xbt/config.hpp>
842 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_cfg);
844 XBT_TEST_SUITE("config", "Configuration support");
846 XBT_PUBLIC_DATA(xbt_cfg_t) simgrid_config;
848 static void make_set()
850 simgrid_config = nullptr;
851 xbt_log_threshold_set(&_XBT_LOGV(xbt_cfg), xbt_log_priority_critical);
852 xbt_cfg_register_int("speed", 0, nullptr, "");
853 xbt_cfg_register_string("peername", "", nullptr, "");
854 xbt_cfg_register_string("user", "", nullptr, "");
855 } /* end_of_make_set */
857 XBT_TEST_UNIT("memuse", test_config_memuse, "Alloc and free a config set")
859 auto temp = simgrid_config;
861 xbt_test_add("Alloc and free a config set");
862 xbt_cfg_set_parse("peername:veloce user:bidule");
863 xbt_cfg_free(&simgrid_config);
864 simgrid_config = temp;
867 XBT_TEST_UNIT("use", test_config_use, "Data retrieving tests")
869 auto temp = simgrid_config;
871 xbt_test_add("Get a single value");
873 /* get_single_value */
876 xbt_cfg_set_parse("peername:toto:42 speed:42");
877 ival = xbt_cfg_get_int("speed");
879 xbt_test_fail("Speed value = %d, I expected 42", ival);
882 xbt_test_add("Access to a non-existant entry");
885 xbt_cfg_set_parse("color:blue");
887 if (e.category != not_found_error)
888 xbt_test_exception(e);
891 xbt_cfg_free(&simgrid_config);
892 simgrid_config = temp;
895 XBT_TEST_UNIT("c++flags", test_config_cxx_flags, "C++ flags")
897 auto temp = simgrid_config;
899 xbt_test_add("C++ declaration of flags");
901 simgrid::config::Flag<int> int_flag("int", "", 0);
902 simgrid::config::Flag<std::string> string_flag("string", "", "foo");
903 simgrid::config::Flag<double> double_flag("double", "", 0.32);
904 simgrid::config::Flag<bool> bool_flag1("bool1", "", false);
905 simgrid::config::Flag<bool> bool_flag2("bool2", "", true);
907 xbt_test_add("Parse values");
908 xbt_cfg_set_parse("int:42 string:bar double:8.0 bool1:true bool2:false");
909 xbt_test_assert(int_flag == 42, "Check int flag");
910 xbt_test_assert(string_flag == "bar", "Check string flag");
911 xbt_test_assert(double_flag == 8.0, "Check double flag");
912 xbt_test_assert(bool_flag1, "Check bool1 flag");
913 xbt_test_assert(!bool_flag2, "Check bool2 flag");
915 xbt_cfg_free(&simgrid_config);
916 simgrid_config = temp;
919 #endif /* SIMGRID_TEST */