Commit a532a314 authored by Jelte Jansen's avatar Jelte Jansen

renamed files names data_def* to module_spec* to reflect their actual content


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/jelte-configuration@872 e5f2f494-b856-4b98-b285-d166d9295462
parent 9e9a2d19
AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/ext -Wall -Werror
lib_LIBRARIES = libcfgclient.a
libcfgclient_a_SOURCES = data_def.h data_def.cc ccsession.cc ccsession.h
libcfgclient_a_SOURCES = module_spec.h module_spec.cc ccsession.cc ccsession.h
TESTS =
if HAVE_GTEST
TESTS += run_unittests
run_unittests_SOURCES = data_def_unittests.cc run_unittests.cc
run_unittests_SOURCES = module_spec_unittests.cc run_unittests.cc
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = libcfgclient.a $(GTEST_LDADD)
......
......@@ -34,7 +34,7 @@
#include <boost/foreach.hpp>
#include <cc/data.h>
#include <data_def.h>
#include <module_spec.h>
#include <cc/session.h>
//#include "common.h"
......
......@@ -19,7 +19,7 @@
#include <string>
#include <config/data_def.h>
#include <config/module_spec.h>
#include <cc/session.h>
#include <cc/data.h>
......
......@@ -13,7 +13,7 @@
// NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
// WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "data_def.h"
#include "module_spec.h"
#include <sstream>
#include <iostream>
......
......@@ -16,7 +16,7 @@
#include <gtest/gtest.h>
#include <data_def.h>
#include <module_spec.h>
#include <fstream>
......@@ -30,7 +30,7 @@ std::string specfile(const std::string name) {
}
void
data_def_error(const std::string& file,
module_spec_error(const std::string& file,
const std::string& error1,
const std::string& error2 = "",
const std::string& error3 = "")
......@@ -54,7 +54,7 @@ TEST(ModuleSpec, ReadingSpecfiles) {
dd = moduleSpecFromFile(specfile("spec2.spec"));
EXPECT_EQ(dd.getFullSpec()->get("module_spec")
->get("config_data")->size(), 6);
data_def_error("doesnotexist",
module_spec_error("doesnotexist",
"Error opening ",
specfile("doesnotexist"),
": No such file or directory");
......@@ -68,54 +68,54 @@ TEST(ModuleSpec, ReadingSpecfiles) {
}
TEST(ModuleSpec, SpecfileItems) {
data_def_error("spec3.spec",
module_spec_error("spec3.spec",
"item_name missing in {\"item_default\": 1, \"item_optional\": False, \"item_type\": \"integer\"}");
data_def_error("spec4.spec",
module_spec_error("spec4.spec",
"item_type missing in {\"item_default\": 1, \"item_name\": \"item1\", \"item_optional\": False}");
data_def_error("spec5.spec",
module_spec_error("spec5.spec",
"item_optional missing in {\"item_default\": 1, \"item_name\": \"item1\", \"item_type\": \"integer\"}");
data_def_error("spec6.spec",
module_spec_error("spec6.spec",
"item_default missing in {\"item_name\": \"item1\", \"item_optional\": False, \"item_type\": \"integer\"}");
data_def_error("spec9.spec",
module_spec_error("spec9.spec",
"item_default not of type integer");
data_def_error("spec10.spec",
module_spec_error("spec10.spec",
"item_default not of type real");
data_def_error("spec11.spec",
module_spec_error("spec11.spec",
"item_default not of type boolean");
data_def_error("spec12.spec",
module_spec_error("spec12.spec",
"item_default not of type string");
data_def_error("spec13.spec",
module_spec_error("spec13.spec",
"item_default not of type list");
data_def_error("spec14.spec",
module_spec_error("spec14.spec",
"item_default not of type map");
data_def_error("spec15.spec",
module_spec_error("spec15.spec",
"badname is not a valid type name");
}
TEST(ModuleSpec, SpecfileConfigData)
{
data_def_error("spec7.spec",
module_spec_error("spec7.spec",
"module_name missing in {}");
data_def_error("spec8.spec",
module_spec_error("spec8.spec",
"Data specification does not contain module_spec element");
data_def_error("spec16.spec",
module_spec_error("spec16.spec",
"config_data is not a list of elements");
data_def_error("spec21.spec",
module_spec_error("spec21.spec",
"commands is not a list of elements");
}
TEST(ModuleSpec, SpecfileCommands)
{
data_def_error("spec17.spec",
module_spec_error("spec17.spec",
"command_name missing in {\"command_args\": [ {\"item_default\": \"\", \"item_name\": \"message\", \"item_optional\": False, \"item_type\": \"string\"} ], \"command_description\": \"Print the given message to stdout\"}");
data_def_error("spec18.spec",
module_spec_error("spec18.spec",
"command_args missing in {\"command_description\": \"Print the given message to stdout\", \"command_name\": \"print_message\"}");
data_def_error("spec19.spec",
module_spec_error("spec19.spec",
"command_args not of type list");
data_def_error("spec20.spec",
module_spec_error("spec20.spec",
"somethingbad is not a valid type name");
/*
data_def_error("spec22.spec",
module_spec_error("spec22.spec",
"");
*/
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment