/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
{
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_cfg);
xbt_log_threshold_set(&_XBT_LOGV(xbt_cfg), xbt_log_priority_critical);
{
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_cfg);
xbt_log_threshold_set(&_XBT_LOGV(xbt_cfg), xbt_log_priority_critical);
simgrid_config = nullptr;
simgrid::config::declare_flag<int>("speed", "description", 0);
simgrid::config::declare_flag<std::string>("peername", "description", "");
simgrid::config::declare_flag<std::string>("user", "description", "");
simgrid_config = nullptr;
simgrid::config::declare_flag<int>("speed", "description", 0);
simgrid::config::declare_flag<std::string>("peername", "description", "");
simgrid::config::declare_flag<std::string>("user", "description", "");
INFO("Get a single value");
/* get_single_value */
simgrid::config::set_parse("peername:toto:42 speed:42");
int ival = simgrid::config::get_value<int>("speed");
REQUIRE(ival == 42); // Unexpected value for speed
INFO("Get a single value");
/* get_single_value */
simgrid::config::set_parse("peername:toto:42 speed:42");
int ival = simgrid::config::get_value<int>("speed");
REQUIRE(ival == 42); // Unexpected value for speed
INFO("C++ declaration of flags");
simgrid::config::Flag<int> int_flag("int", "", 0);
INFO("C++ declaration of flags");
simgrid::config::Flag<int> int_flag("int", "", 0);
REQUIRE(double_flag == 8.0); // Check double flag
REQUIRE(bool_flag1); // Check bool1 flag
REQUIRE(not bool_flag2); // Check bool2 flag
REQUIRE(double_flag == 8.0); // Check double flag
REQUIRE(bool_flag1); // Check bool1 flag
REQUIRE(not bool_flag2); // Check bool2 flag