diff options
Diffstat (limited to 'searchlib/src')
-rw-r--r-- | searchlib/src/tests/attribute/attribute_test.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/searchlib/src/tests/attribute/attribute_test.cpp b/searchlib/src/tests/attribute/attribute_test.cpp index 5c0e2c26bd2..18896ca24c1 100644 --- a/searchlib/src/tests/attribute/attribute_test.cpp +++ b/searchlib/src/tests/attribute/attribute_test.cpp @@ -896,6 +896,8 @@ AttributeTest::testSingle() fillNumeric(nibbleValues, numUniqueNibbles); { AttributePtr ptr = createAttribute("sv-int32", Config(BasicType::INT32, CollectionType::SINGLE)); + ptr->updateStat(true); + EXPECT_EQ(12288u, ptr->getStatus().getAllocated()); addDocs(ptr, numDocs); testSingle<IntegerAttribute, AttributeVector::largeint_t, int32_t>(ptr, values); } @@ -908,6 +910,8 @@ AttributeTest::testSingle() Config cfg(BasicType::INT32, CollectionType::SINGLE); cfg.setFastSearch(true); AttributePtr ptr = createAttribute("sv-post-int32", cfg); + ptr->updateStat(true); + EXPECT_EQ(231640u, ptr->getStatus().getAllocated()); addDocs(ptr, numDocs); testSingle<IntegerAttribute, AttributeVector::largeint_t, int32_t>(ptr, values); } @@ -917,6 +921,8 @@ AttributeTest::testSingle() fillNumeric(values, numUniques); { AttributePtr ptr = createAttribute("sv-float", Config(BasicType::FLOAT, CollectionType::SINGLE)); + ptr->updateStat(true); + EXPECT_EQ(12288u, ptr->getStatus().getAllocated()); addDocs(ptr, numDocs); testSingle<FloatingPointAttribute, double, float>(ptr, values); } @@ -924,6 +930,8 @@ AttributeTest::testSingle() Config cfg(BasicType::FLOAT, CollectionType::SINGLE); cfg.setFastSearch(true); AttributePtr ptr = createAttribute("sv-post-float", cfg); + ptr->updateStat(true); + EXPECT_EQ(231640u, ptr->getStatus().getAllocated()); addDocs(ptr, numDocs); testSingle<FloatingPointAttribute, double, float>(ptr, values); } @@ -934,6 +942,8 @@ AttributeTest::testSingle() fillString(values, numUniques); { AttributePtr ptr = createAttribute("sv-string", Config(BasicType::STRING, CollectionType::SINGLE)); + ptr->updateStat(true); + EXPECT_EQ(74648u, ptr->getStatus().getAllocated()); addDocs(ptr, numDocs); testSingle<StringAttribute, string, string>(ptr, values); } @@ -941,6 +951,8 @@ AttributeTest::testSingle() Config cfg(Config(BasicType::STRING, CollectionType::SINGLE)); cfg.setFastSearch(true); AttributePtr ptr = createAttribute("sv-fs-string", cfg); + ptr->updateStat(true); + EXPECT_EQ(245024u, ptr->getStatus().getAllocated()); addDocs(ptr, numDocs); testSingle<StringAttribute, string, string>(ptr, values); } @@ -1070,6 +1082,8 @@ AttributeTest::testArray() fillNumeric(values, numUniques); { AttributePtr ptr = createAttribute("a-int32", Config(BasicType::INT32, CollectionType::ARRAY)); + ptr->updateStat(true); + EXPECT_EQ(12320u, ptr->getStatus().getAllocated()); addDocs(ptr, numDocs); testArray<IntegerAttribute, AttributeVector::largeint_t>(ptr, values); } @@ -1077,6 +1091,8 @@ AttributeTest::testArray() Config cfg(BasicType::INT8, CollectionType::ARRAY); cfg.setFastSearch(true); AttributePtr ptr = createAttribute("flags", cfg); + ptr->updateStat(true); + EXPECT_EQ(12320u, ptr->getStatus().getAllocated()); addDocs(ptr, numDocs); testArray<IntegerAttribute, AttributeVector::largeint_t>(ptr, values); } @@ -1084,6 +1100,8 @@ AttributeTest::testArray() Config cfg(BasicType::INT32, CollectionType::ARRAY); cfg.setFastSearch(true); AttributePtr ptr = createAttribute("a-fs-int32", cfg); + ptr->updateStat(true); + EXPECT_EQ(253608u, ptr->getStatus().getAllocated()); addDocs(ptr, numDocs); testArray<IntegerAttribute, AttributeVector::largeint_t>(ptr, values); } @@ -1100,6 +1118,8 @@ AttributeTest::testArray() Config cfg(BasicType::FLOAT, CollectionType::ARRAY); cfg.setFastSearch(true); AttributePtr ptr = createAttribute("a-fs-float", cfg); + ptr->updateStat(true); + EXPECT_EQ(253608u, ptr->getStatus().getAllocated()); addDocs(ptr, numDocs); testArray<FloatingPointAttribute, double>(ptr, values); } @@ -1109,6 +1129,8 @@ AttributeTest::testArray() fillString(values, numUniques); { AttributePtr ptr = createAttribute("a-string", Config(BasicType::STRING, CollectionType::ARRAY)); + ptr->updateStat(true); + EXPECT_EQ(74680u, ptr->getStatus().getAllocated()); addDocs(ptr, numDocs); testArray<StringAttribute, string>(ptr, values); } @@ -1116,6 +1138,8 @@ AttributeTest::testArray() Config cfg(BasicType::STRING, CollectionType::ARRAY); cfg.setFastSearch(true); AttributePtr ptr = createAttribute("afs-string", cfg); + ptr->updateStat(true); + EXPECT_EQ(266992u, ptr->getStatus().getAllocated()); addDocs(ptr, numDocs); testArray<StringAttribute, string>(ptr, values); } |