From dcf154aaf037ac67260abcec0b0ed3db32bc65ac Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Tue, 13 Jan 2015 02:01:30 +0100 Subject: allowing validated methods --- test/core/common/ArgumentTest.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'test/core/common/ArgumentTest.cpp') diff --git a/test/core/common/ArgumentTest.cpp b/test/core/common/ArgumentTest.cpp index d58f71b..0dec809 100644 --- a/test/core/common/ArgumentTest.cpp +++ b/test/core/common/ArgumentTest.cpp @@ -471,11 +471,11 @@ TEST(Argument, validateObjectDefault) } } -static std::shared_ptr helloWorldFun{new Method{[]( - const Variant::arrayType &arr, void *) { return Variant{"Hello World"}; }}}; +static std::shared_ptr helloWorldFun{new Method{ + [](Variant::arrayType &arr, void *) { return Variant{"Hello World"}; }}}; static std::shared_ptr goodbyeWorldFun{ - new Method{[](const Variant::arrayType &arr, + new Method{[](Variant::arrayType &arr, void *) { return Variant{"Goodbye Cruel World"}; }}}; TEST(Argument, validateFunction) @@ -835,31 +835,38 @@ TEST(Arguments, validateMap) { Variant::mapType map{{"a", 2}, {"c", false}}; ASSERT_TRUE(args.validateMap(map, logger, false)); - ASSERT_EQ(Variant::mapType({{"a", 2}, {"b", "test"}, {"c", false}}), map); + ASSERT_EQ(Variant::mapType({{"a", 2}, {"b", "test"}, {"c", false}}), + map); } { Variant::mapType map{{"a", 2}}; ASSERT_TRUE(args.validateMap(map, logger, false)); - ASSERT_EQ(Variant::mapType({{"a", 2}, {"b", "test"}, {"c", true}}), map); + ASSERT_EQ(Variant::mapType({{"a", 2}, {"b", "test"}, {"c", true}}), + map); } { Variant::mapType map{}; ASSERT_FALSE(args.validateMap(map, logger, false)); - ASSERT_EQ(Variant::mapType({{"a", 0}, {"b", "test"}, {"c", true}}), map); + ASSERT_EQ(Variant::mapType({{"a", 0}, {"b", "test"}, {"c", true}}), + map); } { Variant::mapType map{{"a", 2}, {"d", nullptr}}; ASSERT_FALSE(args.validateMap(map, logger, false)); - ASSERT_EQ(Variant::mapType({{"a", 2}, {"b", "test"}, {"c", true}, {"d", nullptr}}), map); + ASSERT_EQ(Variant::mapType( + {{"a", 2}, {"b", "test"}, {"c", true}, {"d", nullptr}}), + map); } { Variant::mapType map{{"a", 2}, {"d", nullptr}}; ASSERT_TRUE(args.validateMap(map, logger, true)); - ASSERT_EQ(Variant::mapType({{"a", 2}, {"b", "test"}, {"c", true}, {"d", nullptr}}), map); + ASSERT_EQ(Variant::mapType( + {{"a", 2}, {"b", "test"}, {"c", true}, {"d", nullptr}}), + map); } } } -- cgit v1.2.3