summaryrefslogtreecommitdiff
path: root/src/unittests/fs/virtfs
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-01 04:05:51 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-01 04:05:51 +0300
commit59d9b799fa5bf3c8ba99cc6f703b83751f1d3497 (patch)
tree16b29e2afda9f223f36e6a7d3f4659fb72d3d7e6 /src/unittests/fs/virtfs
parentb9ce7a70632f31a3a4b29841ab034dbb297b295d (diff)
downloadplus-59d9b799fa5bf3c8ba99cc6f703b83751f1d3497.tar.gz
plus-59d9b799fa5bf3c8ba99cc6f703b83751f1d3497.tar.bz2
plus-59d9b799fa5bf3c8ba99cc6f703b83751f1d3497.tar.xz
plus-59d9b799fa5bf3c8ba99cc6f703b83751f1d3497.zip
Fix unit tests after last changes in configuration.cpp
Diffstat (limited to 'src/unittests/fs/virtfs')
-rw-r--r--src/unittests/fs/virtfs/throw.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/unittests/fs/virtfs/throw.cc b/src/unittests/fs/virtfs/throw.cc
index 377230686..b15572d20 100644
--- a/src/unittests/fs/virtfs/throw.cc
+++ b/src/unittests/fs/virtfs/throw.cc
@@ -20,6 +20,10 @@
#include "unittests/unittests.h"
+#include "configmanager.h"
+#include "configuration.h"
+#include "dirs.h"
+
#include "fs/files.h"
#include "fs/virtfs/fs.h"
@@ -231,3 +235,24 @@ TEST_CASE("throw VirtFs1 unmount", "")
VirtFs::deinit();
delete2(logger);
}
+
+TEST_CASE("throw configuration tests", "configuration")
+{
+ logger = new Logger();
+
+ Dirs::initRootDir();
+ Dirs::initHomeDir();
+
+ ConfigManager::initConfiguration();
+
+ SECTION("configuration undefined")
+ {
+ const char *const key = "nonsetvalue";
+ REQUIRE_THROWS(config.getIntValue(key) == 0);
+ REQUIRE_THROWS(config.getFloatValue(key) >= 0.0f);
+ REQUIRE_THROWS(config.getStringValue(key).empty());
+ REQUIRE_THROWS(config.getBoolValue(key) == false);
+ }
+
+ delete2(logger);
+}