Compare commits

...
Author SHA1 Message Date
Michael Harding 189157b1c7 initialize_for_test changes (thanks eric) 2019-06-13 14:50:24 -04:00
2 changed files with 8 additions and 3 deletions

No files matched your search

+6 -2
View File
@@ -89,10 +89,14 @@ namespace internal {
// Functions used in testing
//////////////////////////////////////////
extern "C" BTS_EXPORT void initialize_for_test(const std::string& values, bool print_errors)
extern "C" BTS_EXPORT void initialize_for_test(const char* values, bool print_errors)
{
config_state.reset();
config_state.load_string(values, print_errors);
config_state.load_string(std::string(values), print_errors);
}
void initialize_for_test(const std::string& value, bool print_errors) {
config_state.reset();
config_state.load_string(value, print_errors);
}
extern "C" BTS_EXPORT void reset()
+2 -1
View File
@@ -56,7 +56,8 @@ namespace config {
{
// Initialize configuration state from a string instead of from the filesystem. defaults.conf will still be loaded.
// Calling this a second time clears all values from previous initialization
extern "C" BTS_EXPORT void initialize_for_test(const std::string& configuration, bool print_errors=true);
extern "C" BTS_EXPORT void initialize_for_test(const char* configuration, bool print_errors=true);
void initialize_for_test(const std::string& configuration, bool print_errors=true);
// Releases all resources and returns config to factory defaults
extern "C" BTS_EXPORT void reset();