aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@yahoo-inc.com>2017-03-07 14:29:26 +0000
committerTor Egge <Tor.Egge@yahoo-inc.com>2017-03-07 14:29:26 +0000
commit14ad8659bab596a5125cfe0a1b9f97afd519916d (patch)
tree179fefe5bdb69792fefda147ba756ce43181457a /searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp
parentc75dff6987de2e3fae07dd1ca6802f6525d70b0d (diff)
Stop faking document sizes, real values are now available.
Diffstat (limited to 'searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp')
-rw-r--r--searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp b/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp
index 03690ead45a..3cbbc192cb1 100644
--- a/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/buckethandler/buckethandler_test.cpp
@@ -83,12 +83,12 @@ struct MyModifiedHandler : public IBucketModifiedHandler
bool
-expectEqual(uint32_t docCount, uint32_t metaCount, const BucketInfo &info)
+expectEqual(uint32_t docCount, uint32_t metaCount, size_t docSizes, size_t entrySizes, const BucketInfo &info)
{
if (!EXPECT_EQUAL(docCount, info.getDocumentCount())) return false;
if (!EXPECT_EQUAL(metaCount, info.getEntryCount())) return false;
- if (!EXPECT_EQUAL(docCount, info.getDocumentSize())) return false;
- if (!EXPECT_EQUAL(metaCount, info.getUsedSize())) return false;
+ if (!EXPECT_EQUAL(docSizes, info.getDocumentSize())) return false;
+ if (!EXPECT_EQUAL(entrySizes, info.getUsedSize())) return false;
return true;
}
@@ -172,10 +172,10 @@ TEST_F("require that handleListBuckets() returns buckets from all sub dbs", Fixt
TEST_F("require that bucket is reported in handleGetBucketInfo() and size faked", Fixture)
{
f.handleGetBucketInfo(f._ready.bucket(3));
- EXPECT_TRUE(expectEqual(3, 3, f._bucketInfo.getInfo()));
+ EXPECT_TRUE(expectEqual(3, 3, 3000, 3000, f._bucketInfo.getInfo()));
f.handleGetBucketInfo(f._ready.bucket(2)); // bucket 2 also in removed sub db
- EXPECT_TRUE(expectEqual(2, 6, f._bucketInfo.getInfo()));
+ EXPECT_TRUE(expectEqual(2, 6, 2000, 6000, f._bucketInfo.getInfo()));
}
@@ -188,12 +188,12 @@ TEST_F("require that handleGetBucketInfo() can get cached bucket", Fixture)
db->add(GID_1, BUCKET_1, TIME_1, DOCSIZE_1, SubDbType::NOTREADY);
}
f.handleGetBucketInfo(BUCKET_1);
- EXPECT_TRUE(expectEqual(1, 1, f._bucketInfo.getInfo()));
+ EXPECT_TRUE(expectEqual(1, 1, DOCSIZE_1, DOCSIZE_1, f._bucketInfo.getInfo()));
f._bucketDB->takeGuard()->uncacheBucket();
f.handleGetBucketInfo(BUCKET_1);
- EXPECT_TRUE(expectEqual(2, 2, f._bucketInfo.getInfo()));
+ EXPECT_TRUE(expectEqual(2, 2, 2 * DOCSIZE_1, 2 * DOCSIZE_1, f._bucketInfo.getInfo()));
{
// Must ensure empty bucket db before destruction.
BucketDBOwner::Guard db = f._bucketDB->takeGuard();