From f95e202d7e972f92ebf5ee9ca11c4ad846cd1524 Mon Sep 17 00:00:00 2001 From: Mukund Sivaraman Date: Fri, 30 Mar 2012 03:45:26 +0530 Subject: [PATCH] [1627] Add a couple more testcases * Case when no file is specified * Case where both origin and file are not specified --- src/bin/auth/tests/config_unittest.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/bin/auth/tests/config_unittest.cc b/src/bin/auth/tests/config_unittest.cc index a80a9c80e5..96e447c35c 100644 --- a/src/bin/auth/tests/config_unittest.cc +++ b/src/bin/auth/tests/config_unittest.cc @@ -313,6 +313,13 @@ TEST_F(MemoryDatasrcConfigTest, addDuplicateZones) { } TEST_F(MemoryDatasrcConfigTest, addBadZone) { + // origin and file are missing + EXPECT_THROW(parser->build( + Element::fromJSON( + "[{\"type\": \"memory\"," + " \"zones\": [{}]}]")), + AuthConfigError); + // origin is missing EXPECT_THROW(parser->build( Element::fromJSON( @@ -320,6 +327,13 @@ TEST_F(MemoryDatasrcConfigTest, addBadZone) { " \"zones\": [{\"file\": \"example.zone\"}]}]")), AuthConfigError); + // file is missing + EXPECT_THROW(parser->build( + Element::fromJSON( + "[{\"type\": \"memory\"," + " \"zones\": [{\"origin\": \"example.com\"}]}]")), + AuthConfigError); + // missing zone file EXPECT_THROW(parser->build( Element::fromJSON(