From 851aa78167e7f23a6a6ec68b7e2252d4b4684f97 Mon Sep 17 00:00:00 2001 From: hotwatermorning Date: Tue, 26 Jan 2016 14:42:49 +0900 Subject: [PATCH] Add test cases for Json11. --- tests/test_adapter_comparison.cpp | 46 +++++++++++++++++++++++++++++++ tests/test_validator.cpp | 3 ++ 2 files changed, 49 insertions(+) diff --git a/tests/test_adapter_comparison.cpp b/tests/test_adapter_comparison.cpp index d1e8af0..a8164c5 100644 --- a/tests/test_adapter_comparison.cpp +++ b/tests/test_adapter_comparison.cpp @@ -9,10 +9,12 @@ #include #include #include +#include #include #include #include #include +#include #define TEST_DATA_DIR "../tests/data/documents/" @@ -155,6 +157,13 @@ TEST_F(TestAdapterComparison, JsonCppVsRapidJsonCrtAlloc) rapidjson::CrtAllocator> > >(); } +TEST_F(TestAdapterComparison, JsonCppVsJson11) +{ + testComparison< + valijson::adapters::JsonCppAdapter, + valijson::adapters::Json11Adapter>(); +} + TEST_F(TestAdapterComparison, PropertyTreeVsPicoJson) { testComparison< @@ -234,3 +243,40 @@ TEST_F(TestAdapterComparison, RapidJsonCrtAllocVsRapidJsonCrtAlloc) rapidjson::GenericValue, rapidjson::CrtAllocator> > >(); } + +TEST_F(TestAdapterComparison, Json11VsJson11) +{ + testComparison< + valijson::adapters::Json11Adapter, + valijson::adapters::Json11Adapter>(); +} + +TEST_F(TestAdapterComparison, Json11VsRapidJson) +{ + testComparison< + valijson::adapters::Json11Adapter, + valijson::adapters::RapidJsonAdapter>(); +} + +TEST_F(TestAdapterComparison, Json11VsRapidJsonCrtAlloc) +{ + testComparison< + valijson::adapters::Json11Adapter, + valijson::adapters::GenericRapidJsonAdapter< + rapidjson::GenericValue, + rapidjson::CrtAllocator> > >(); +} + +TEST_F(TestAdapterComparison, Json11VsPicoJson) +{ + testComparison< + valijson::adapters::Json11Adapter, + valijson::adapters::PicoJsonAdapter>(); +} + +TEST_F(TestAdapterComparison, Json11VsPropertyTree) +{ + testComparison< + valijson::adapters::Json11Adapter, + valijson::adapters::PropertyTreeAdapter>(); +} diff --git a/tests/test_validator.cpp b/tests/test_validator.cpp index f3eeb21..2d6b2e8 100644 --- a/tests/test_validator.cpp +++ b/tests/test_validator.cpp @@ -10,9 +10,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -116,6 +118,7 @@ protected: processTestFile(testFile, version); processTestFile(testFile, version); processTestFile(testFile, version); + processTestFile(testFile, version); } void processDraft3TestFile(const std::string &testFile)