summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-15 02:31:29 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-15 02:31:29 +0100
commit86885e5a63c10d264bac822cb054607c27c0f734 (patch)
tree85362383a4e0726b8c89475b939f1d0d44ec0dea /test
parent2a9541b06b4741f268929377946e720af1418ba0 (diff)
Fixed bug in Argument validation when missing values are inserted (string types got "null" as default value and not ""), added corresponding unit test
Diffstat (limited to 'test')
-rw-r--r--test/core/common/ArgumentTest.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/core/common/ArgumentTest.cpp b/test/core/common/ArgumentTest.cpp
index c8ecd2f..85f99a1 100644
--- a/test/core/common/ArgumentTest.cpp
+++ b/test/core/common/ArgumentTest.cpp
@@ -881,5 +881,23 @@ TEST(Arguments, validateMap)
map);
}
}
+
+TEST(Arguments, validateMissing)
+{
+ Arguments args{Argument::String("a")};
+
+ {
+ Variant::mapType map{};
+ ASSERT_FALSE(args.validateMap(map, logger, false));
+ ASSERT_EQ(Variant::mapType({{"a", ""}}), map);
+ }
+
+ {
+ Variant::arrayType arr{};
+ ASSERT_FALSE(args.validateArray(arr, logger));
+ ASSERT_EQ(Variant::arrayType({""}), arr);
+ }
+}
+
}