summaryrefslogtreecommitdiff
path: root/project2/common/unittests/testConfig.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'project2/common/unittests/testConfig.cpp')
-rw-r--r--project2/common/unittests/testConfig.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/project2/common/unittests/testConfig.cpp b/project2/common/unittests/testConfig.cpp
new file mode 100644
index 0000000..8c25394
--- /dev/null
+++ b/project2/common/unittests/testConfig.cpp
@@ -0,0 +1,18 @@
+#define BOOST_TEST_MODULE Config
+#include <boost/test/unit_test.hpp>
+#include <testOptionsSource.h>
+#include <testScriptNode.h>
+#include <variables.h>
+
+BOOST_AUTO_TEST_CASE( config_application_value )
+{
+ TestOptionsSource::LoadTestOptions({
+ { "application.data", "testvalue" }
+ });
+ Variable::VariableImplPtr c = VariableLoader::createNew("config", new TestScriptNode({
+ { "name", VariableType("data") }
+ }));
+ BOOST_REQUIRE(c);
+ BOOST_REQUIRE_EQUAL("testvalue", c->value(NULL).as<std::string>());
+}
+