diff options
author | Arne H Juul <arnej27959@users.noreply.github.com> | 2017-04-24 12:10:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-24 12:10:42 +0200 |
commit | 9ff4bdb407ed8d855a3f86a17c99906ff738177b (patch) | |
tree | fc2b050224d7dde92d57e1f9cac12c1e5aaf6b90 /document | |
parent | 32ae190acc9ac5081049e1c7008d1602c68cf821 (diff) |
Revert "Balder/enforce override 2"
Diffstat (limited to 'document')
-rw-r--r-- | document/src/tests/arrayfieldvaluetest.cpp | 4 | ||||
-rw-r--r-- | document/src/tests/documentselectparsertest.cpp | 102 | ||||
-rw-r--r-- | document/src/tests/documentupdatetestcase.cpp | 2 | ||||
-rw-r--r-- | document/src/tests/primitivefieldvaluetest.cpp | 3 | ||||
-rw-r--r-- | document/src/tests/serialization/annotationserializer_test.cpp | 1 | ||||
-rw-r--r-- | document/src/tests/structfieldvaluetest.cpp | 2 | ||||
-rw-r--r-- | document/src/tests/testrunner.cpp | 5 | ||||
-rw-r--r-- | document/src/tests/teststringutil.h | 2 | ||||
-rw-r--r-- | document/src/tests/weightedsetfieldvaluetest.cpp | 3 |
9 files changed, 101 insertions, 23 deletions
diff --git a/document/src/tests/arrayfieldvaluetest.cpp b/document/src/tests/arrayfieldvaluetest.cpp index 7f31e0c3b3a..85659c0cbb4 100644 --- a/document/src/tests/arrayfieldvaluetest.cpp +++ b/document/src/tests/arrayfieldvaluetest.cpp @@ -1,5 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include <vespa/fastos/fastos.h> #include <vespa/document/fieldvalue/fieldvalues.h> #include <vespa/document/serialization/vespadocumentdeserializer.h> #include <vespa/vdstestlib/cppunit/macros.h> @@ -10,6 +11,9 @@ using vespalib::nbostream; namespace document { struct ArrayFieldValueTest : public CppUnit::TestFixture { + void setUp() override {} + void tearDown() override {} + void testArray(); CPPUNIT_TEST_SUITE(ArrayFieldValueTest); diff --git a/document/src/tests/documentselectparsertest.cpp b/document/src/tests/documentselectparsertest.cpp index 6957634cbde..8e17dd12e12 100644 --- a/document/src/tests/documentselectparsertest.cpp +++ b/document/src/tests/documentselectparsertest.cpp @@ -1,12 +1,17 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +//#include <boost/regex/icu.hpp> +#include <vespa/fastos/fastos.h> #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include <vespa/document/repo/configbuilder.h> #include <vespa/document/repo/documenttyperepo.h> +#include <iostream> +#include <memory> #include <vespa/document/update/assignvalueupdate.h> #include <vespa/document/base/testdocman.h> +#include <vespa/document/base/testdocrepo.h> #include <vespa/document/select/parser.h> #include <vespa/document/select/visitor.h> #include <vespa/document/select/bodyfielddetector.h> @@ -61,6 +66,7 @@ public: : _bucketIdFactory() {} void setUp() override; + void tearDown() override {} void createDocs(); void testParseTerminals(); @@ -906,27 +912,32 @@ namespace { std::ostringstream data; public: - ~TestVisitor() {} + virtual ~TestVisitor() {} - void visitConstant(const select::Constant& node) override { + void visitConstant(const select::Constant& node) override + { data << "CONSTANT(" << node << ")"; } - void - visitInvalidConstant(const select::InvalidConstant& node) override { + virtual void + visitInvalidConstant(const select::InvalidConstant& node) override + { data << "INVALIDCONSTANT(" << node << ")"; } - void visitDocumentType(const select::DocType& node) override { + void visitDocumentType(const select::DocType& node) override + { data << "DOCTYPE(" << node << ")"; } - void visitComparison(const select::Compare& node) override { + void visitComparison(const select::Compare& node) override + { data << "COMPARE(" << node.getLeft() << " " << node.getOperator() << " " << node.getRight() << ")"; } - void visitAndBranch(const select::And& node) override { + void visitAndBranch(const select::And& node) override + { data << "AND("; node.getLeft().visit(*this); data << ", "; @@ -934,7 +945,8 @@ namespace { data << ")"; } - void visitOrBranch(const select::Or& node) override { + void visitOrBranch(const select::Or& node) override + { data << "OR("; node.getLeft().visit(*this); data << ", "; @@ -942,24 +954,72 @@ namespace { data << ")"; } - void visitNotBranch(const select::Not& node) override { + void visitNotBranch(const select::Not& node) override + { data << "NOT("; node.getChild().visit(*this); data << ")"; } - void visitArithmeticValueNode(const select::ArithmeticValueNode &) override {} - void visitFunctionValueNode(const select::FunctionValueNode &) override {} - void visitIdValueNode(const select::IdValueNode &) override {} - void visitSearchColumnValueNode(const select::SearchColumnValueNode &) override {} - void visitFieldValueNode(const select::FieldValueNode &) override {} - void visitFloatValueNode(const select::FloatValueNode &) override {} - void visitVariableValueNode(const select::VariableValueNode &) override {} - void visitIntegerValueNode(const select::IntegerValueNode &) override {} - void visitCurrentTimeValueNode(const select::CurrentTimeValueNode &) override {} - void visitStringValueNode(const select::StringValueNode &) override {} - void visitNullValueNode(const select::NullValueNode &) override {} - void visitInvalidValueNode(const select::InvalidValueNode &) override {} + virtual void + visitArithmeticValueNode(const select::ArithmeticValueNode &) override + { + } + + virtual void + visitFunctionValueNode(const select::FunctionValueNode &) override + { + } + + virtual void + visitIdValueNode(const select::IdValueNode &) override + { + } + + virtual void + visitSearchColumnValueNode(const select::SearchColumnValueNode &) override + { + } + + virtual void + visitFieldValueNode(const select::FieldValueNode &) override + { + } + + virtual void + visitFloatValueNode(const select::FloatValueNode &) override + { + } + + virtual void + visitVariableValueNode(const select::VariableValueNode &) override + { + } + + virtual void + visitIntegerValueNode(const select::IntegerValueNode &) override + { + } + + virtual void + visitCurrentTimeValueNode(const select::CurrentTimeValueNode &) override + { + } + + virtual void + visitStringValueNode(const select::StringValueNode &) override + { + } + + virtual void + visitNullValueNode(const select::NullValueNode &) override + { + } + + virtual void + visitInvalidValueNode(const select::InvalidValueNode &) override + { + } std::string getVisitString() { return data.str(); } }; diff --git a/document/src/tests/documentupdatetestcase.cpp b/document/src/tests/documentupdatetestcase.cpp index baa777ceca1..5ac7c48c7ad 100644 --- a/document/src/tests/documentupdatetestcase.cpp +++ b/document/src/tests/documentupdatetestcase.cpp @@ -33,6 +33,8 @@ using vespalib::tensor::TensorDimensions; namespace document { struct DocumentUpdateTest : public CppUnit::TestFixture { + void setUp() override {} + void tearDown() override {} void testSimpleUsage(); void testUpdateApplySingleValue(); diff --git a/document/src/tests/primitivefieldvaluetest.cpp b/document/src/tests/primitivefieldvaluetest.cpp index 15fd6e00959..ba81e0ebbf6 100644 --- a/document/src/tests/primitivefieldvaluetest.cpp +++ b/document/src/tests/primitivefieldvaluetest.cpp @@ -1,5 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include <vespa/fastos/fastos.h> #include <vespa/document/fieldvalue/fieldvalues.h> #include <vespa/document/serialization/vespadocumentdeserializer.h> #include <vespa/vdstestlib/cppunit/macros.h> @@ -10,6 +11,8 @@ using vespalib::nbostream; namespace document { struct PrimitiveFieldValueTest : public CppUnit::TestFixture { + void setUp() override {} + void tearDown() override {} void testLiterals(); void testRaw(); diff --git a/document/src/tests/serialization/annotationserializer_test.cpp b/document/src/tests/serialization/annotationserializer_test.cpp index 49860df128d..9be0d6d334e 100644 --- a/document/src/tests/serialization/annotationserializer_test.cpp +++ b/document/src/tests/serialization/annotationserializer_test.cpp @@ -1,4 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Unit tests for annotation serialization. #include <vespa/document/base/testdocrepo.h> #include <vespa/document/annotation/alternatespanlist.h> diff --git a/document/src/tests/structfieldvaluetest.cpp b/document/src/tests/structfieldvaluetest.cpp index d6e585e0987..0daf8c97302 100644 --- a/document/src/tests/structfieldvaluetest.cpp +++ b/document/src/tests/structfieldvaluetest.cpp @@ -17,6 +17,8 @@ namespace document { struct StructFieldValueTest : public CppUnit::TestFixture { DocumentTypeRepo doc_repo; StructFieldValueTest(); + void setUp() override {} + void tearDown() override {} void testStruct(); void testEmptyStruct(); diff --git a/document/src/tests/testrunner.cpp b/document/src/tests/testrunner.cpp index 815476a3f41..aabdbb3f605 100644 --- a/document/src/tests/testrunner.cpp +++ b/document/src/tests/testrunner.cpp @@ -1,12 +1,13 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include <vespa/fastos/fastos.h> +#include <vespa/log/log.h> #include <vespa/vdstestlib/cppunit/cppunittestrunner.h> -#include <vespa/log/log.h> LOG_SETUP("documentcppunittests"); int -main(int argc, const char *argv[]) +main(int argc, char **argv) { vdstestlib::CppUnitTestRunner testRunner; return testRunner.run(argc, argv); diff --git a/document/src/tests/teststringutil.h b/document/src/tests/teststringutil.h index cba15682d7e..355d90367ed 100644 --- a/document/src/tests/teststringutil.h +++ b/document/src/tests/teststringutil.h @@ -1,5 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +/* $Id$*/ + #pragma once #include <cppunit/extensions/HelperMacros.h> diff --git a/document/src/tests/weightedsetfieldvaluetest.cpp b/document/src/tests/weightedsetfieldvaluetest.cpp index 81b98da297f..100db297b55 100644 --- a/document/src/tests/weightedsetfieldvaluetest.cpp +++ b/document/src/tests/weightedsetfieldvaluetest.cpp @@ -1,5 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include <vespa/fastos/fastos.h> #include <vespa/document/fieldvalue/fieldvalues.h> #include <vespa/document/serialization/vespadocumentdeserializer.h> #include <vespa/vdstestlib/cppunit/macros.h> @@ -10,6 +11,8 @@ using vespalib::nbostream; namespace document { struct WeightedSetFieldValueTest : public CppUnit::TestFixture { + void setUp() override {} + void tearDown() override {} void testWeightedSet(); void testAddIgnoreZeroWeight(); |