diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-05-27 21:31:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-27 21:31:58 +0200 |
commit | 031e0b85bb6498f3071598a3daaf6bc5721745e1 (patch) | |
tree | d17118e92829506ff1eeccd46163663d87f79787 /searchlib/src/tests/attribute | |
parent | 23e9dd2577e9d5bd32e410e2759a82aad6e185ee (diff) | |
parent | de95c2e46ad17a4d7d959a5c9babb205c29c3265 (diff) |
Merge pull request #22772 from vespa-engine/balder/avoid-identifiable
Avoid using vespalib::Identifiable.
Diffstat (limited to 'searchlib/src/tests/attribute')
6 files changed, 21 insertions, 21 deletions
diff --git a/searchlib/src/tests/attribute/attribute_test.cpp b/searchlib/src/tests/attribute/attribute_test.cpp index 64edb30520b..ab0c6c28ad1 100644 --- a/searchlib/src/tests/attribute/attribute_test.cpp +++ b/searchlib/src/tests/attribute/attribute_test.cpp @@ -1,16 +1,11 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/document/fieldvalue/intfieldvalue.h> -#include <vespa/document/fieldvalue/stringfieldvalue.h> -#include <vespa/document/update/arithmeticvalueupdate.h> -#include <vespa/document/update/assignvalueupdate.h> -#include <vespa/document/update/mapvalueupdate.h> + #include <vespa/searchlib/attribute/address_space_components.h> #include <vespa/searchlib/attribute/attribute.h> #include <vespa/searchlib/attribute/attributefactory.h> #include <vespa/searchlib/attribute/attributeguard.h> #include <vespa/searchlib/attribute/attributememorysavetarget.h> -#include <vespa/searchlib/attribute/attributevector.hpp> #include <vespa/searchlib/attribute/multienumattribute.hpp> #include <vespa/searchlib/attribute/multistringattribute.h> #include <vespa/searchlib/attribute/multivalueattribute.hpp> @@ -20,11 +15,17 @@ #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/test/weighted_type_test_utils.h> #include <vespa/searchlib/util/randomgenerator.h> +#include <vespa/document/fieldvalue/intfieldvalue.h> +#include <vespa/document/fieldvalue/stringfieldvalue.h> +#include <vespa/document/update/arithmeticvalueupdate.h> +#include <vespa/document/update/assignvalueupdate.h> +#include <vespa/document/update/mapvalueupdate.h> #include <vespa/vespalib/io/fileutil.h> #include <vespa/vespalib/gtest/gtest.h> #include <vespa/vespalib/util/mmap_file_allocator_factory.h> #include <vespa/vespalib/util/round_up_to_page_size.h> #include <vespa/vespalib/util/size_literals.h> +#include <vespa/vespalib/stllike/asciistream.h> #include <vespa/fastos/file.h> #include <cmath> #include <iostream> @@ -1412,7 +1413,7 @@ AttributeTest::testArithmeticValueUpdate(const AttributePtr & ptr) ASSERT_TRUE(vec.update(0, 100)); EXPECT_TRUE(vec.apply(0, Arith(Arith::Div, 0))); ptr->commit(); - if (ptr->getClass().inherits(FloatingPointAttribute::classId)) { + if (ptr->isFloatingPointType()) { EXPECT_EQ(ptr->getStatus().getUpdateCount(), 86u); EXPECT_EQ(ptr->getStatus().getNonIdempotentUpdateCount(), 66u); } else { // does not apply for interger attributes @@ -1427,7 +1428,7 @@ AttributeTest::testArithmeticValueUpdate(const AttributePtr & ptr) // try divide by zero with empty change vector EXPECT_TRUE(vec.apply(0, Arith(Arith::Div, 0))); ptr->commit(); - if (ptr->getClass().inherits(FloatingPointAttribute::classId)) { + if (ptr->isFloatingPointType()) { EXPECT_EQ(ptr->getStatus().getUpdateCount(), 87u); EXPECT_EQ(ptr->getStatus().getNonIdempotentUpdateCount(), 67u); } else { // does not apply for interger attributes @@ -1486,7 +1487,7 @@ AttributeTest::testArithmeticWithUndefinedValue(const AttributePtr & ptr, BaseTy std::vector<BufferType> buf(1); ptr->get(0, &buf[0], 1); - if (ptr->getClass().inherits(FloatingPointAttribute::classId)) { + if (ptr->isFloatingPointType()) { EXPECT_TRUE(std::isnan(buf[0])); } else { EXPECT_EQ(buf[0], after); diff --git a/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp b/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp index d4dc8c15f23..d1dde5ef6ea 100644 --- a/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp +++ b/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp @@ -4,20 +4,19 @@ #include <vespa/searchlib/attribute/attribute.h> #include <vespa/searchlib/attribute/attributefactory.h> -#include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/util/randomgenerator.h> #include <vespa/vespalib/util/compress.h> #include <vespa/searchlib/fef/termfieldmatchdata.h> - #include <vespa/searchlib/attribute/i_document_weight_attribute.h> #include <vespa/searchlib/queryeval/document_weight_search_iterator.h> #include <vespa/searchlib/test/searchiteratorverifier.h> #include <vespa/searchlib/common/bitvectoriterator.h> +#include <vespa/searchlib/queryeval/executeinfo.h> #include <vespa/searchlib/parsequery/parse.h> #include <vespa/searchcommon/attribute/config.h> +#include <vespa/vespalib/stllike/asciistream.h> #include <vespa/log/log.h> -#include <vespa/searchlib/queryeval/executeinfo.h> LOG_SETUP("bitvector_test"); diff --git a/searchlib/src/tests/attribute/enum_attribute_compaction/enum_attribute_compaction_test.cpp b/searchlib/src/tests/attribute/enum_attribute_compaction/enum_attribute_compaction_test.cpp index 7652e7e30a4..f54e1efdf5c 100644 --- a/searchlib/src/tests/attribute/enum_attribute_compaction/enum_attribute_compaction_test.cpp +++ b/searchlib/src/tests/attribute/enum_attribute_compaction/enum_attribute_compaction_test.cpp @@ -1,12 +1,13 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/vespalib/gtest/gtest.h> -#include <vespa/searchcommon/attribute/attributecontent.h> #include <vespa/searchlib/attribute/attributefactory.h> #include <vespa/searchlib/attribute/integerbase.h> #include <vespa/searchlib/attribute/stringbase.h> -#include <vespa/searchcommon/attribute/config.h> #include <vespa/searchlib/test/weighted_type_test_utils.h> +#include <vespa/searchcommon/attribute/attributecontent.h> +#include <vespa/searchcommon/attribute/config.h> +#include <vespa/vespalib/stllike/asciistream.h> +#include <vespa/vespalib/gtest/gtest.h> #include <vespa/log/log.h> LOG_SETUP("enum_attribute_compaction_test"); diff --git a/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp b/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp index 44ae4f7385e..92c3da40fe9 100644 --- a/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp +++ b/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp @@ -1,7 +1,5 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/document/fieldvalue/intfieldvalue.h> -#include <vespa/document/fieldvalue/stringfieldvalue.h> #include <vespa/searchlib/attribute/attribute.h> #include <vespa/searchlib/attribute/attributefactory.h> #include <vespa/searchlib/attribute/attributefilesavetarget.h> @@ -18,13 +16,13 @@ #include <vespa/searchlib/util/file_settings.h> #include <vespa/searchlib/util/randomgenerator.h> #include <vespa/searchcommon/attribute/config.h> +#include <vespa/document/fieldvalue/intfieldvalue.h> +#include <vespa/document/fieldvalue/stringfieldvalue.h> #include <vespa/vespalib/data/databuffer.h> #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/compress.h> -#include <vespa/vespalib/util/size_literals.h> - +#include <vespa/vespalib/stllike/asciistream.h> #include <limits> -#include <iostream> #include <cmath> using search::AttributeFactory; diff --git a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp index 48f56394800..6df60f2ac4c 100644 --- a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp +++ b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp @@ -279,7 +279,7 @@ void add_docs(AttributeVector *attr, size_t n) { AttributeVector::DocId docid; for (size_t i = 0; i < n; ++i) { attr->addDoc(docid); - if (attr->inherits(PredicateAttribute::classId)) { + if (attr->isPredicateType()) { const_cast<uint8_t *>(static_cast<PredicateAttribute *>(attr)->getMinFeatureVector().first)[docid] = 0; } } diff --git a/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp b/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp index 78d82459260..6390e30adff 100644 --- a/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp +++ b/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp @@ -20,6 +20,7 @@ #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/compress.h> #include <vespa/vespalib/util/stringfmt.h> +#include <vespa/vespalib/stllike/asciistream.h> #include <set> #include <vespa/log/log.h> |