Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust types in storage module. #8798

Merged
merged 2 commits into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion storage/src/tests/distributor/bucketdatabasetest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ BucketDatabaseTest::testClear() {
db().update(BucketDatabase::Entry(document::BucketId(16, 16), BI(1)));
db().update(BucketDatabase::Entry(document::BucketId(16, 11), BI(2)));
db().clear();
CPPUNIT_ASSERT_EQUAL(size_t(0), db().size());
CPPUNIT_ASSERT_EQUAL(uint64_t(0), db().size());
}

void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ BucketGcTimeCalculatorTest::identityHasherReturnsBucketId()
BucketGcTimeCalculator::BucketIdIdentityHasher hasher2;
document::BucketId bucket(36, 1234);

CPPUNIT_ASSERT_EQUAL(bucket.getId(), hasher2.hash(bucket));
CPPUNIT_ASSERT_EQUAL(bucket.getId(), static_cast<uint64_t>(hasher2.hash(bucket)));
}

} // distributor
Expand Down
6 changes: 3 additions & 3 deletions storage/src/tests/distributor/updateoperationtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ UpdateOperation_Test::testSimple()
sender.getLastReply(true));

auto& metrics = getDistributor().getMetrics().updates[documentapi::LoadType::DEFAULT];
CPPUNIT_ASSERT_EQUAL(0UL, metrics.diverging_timestamp_updates.getValue());
CPPUNIT_ASSERT_EQUAL(UINT64_C(0), metrics.diverging_timestamp_updates.getValue());
}

void
Expand Down Expand Up @@ -173,7 +173,7 @@ UpdateOperation_Test::testMultiNode()
dumpBucket(_bId));

auto& metrics = getDistributor().getMetrics().updates[documentapi::LoadType::DEFAULT];
CPPUNIT_ASSERT_EQUAL(0UL, metrics.diverging_timestamp_updates.getValue());
CPPUNIT_ASSERT_EQUAL(UINT64_C(0), metrics.diverging_timestamp_updates.getValue());
}

void
Expand All @@ -196,6 +196,6 @@ UpdateOperation_Test::testMultiNodeInconsistentTimestamp()
sender.getLastReply(true));

auto& metrics = getDistributor().getMetrics().updates[documentapi::LoadType::DEFAULT];
CPPUNIT_ASSERT_EQUAL(1UL, metrics.diverging_timestamp_updates.getValue());
CPPUNIT_ASSERT_EQUAL(UINT64_C(1), metrics.diverging_timestamp_updates.getValue());
}

20 changes: 10 additions & 10 deletions storage/src/tests/persistence/mergehandlertest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,14 @@ MergeHandlerTest::testMergeBucketCommand()
MessageTracker::UP tracker = handler.handleMergeBucket(cmd, *_context);

LOG(info, "Check state");
CPPUNIT_ASSERT_EQUAL(uint64_t(1), messageKeeper()._msgs.size());
CPPUNIT_ASSERT_EQUAL(size_t(1), messageKeeper()._msgs.size());
CPPUNIT_ASSERT_EQUAL(api::MessageType::GETBUCKETDIFF,
messageKeeper()._msgs[0]->getType());
api::GetBucketDiffCommand& cmd2(dynamic_cast<api::GetBucketDiffCommand&>(
*messageKeeper()._msgs[0]));
CPPUNIT_ASSERT_EQUAL(_nodes, cmd2.getNodes());
std::vector<api::GetBucketDiffCommand::Entry> diff(cmd2.getDiff());
CPPUNIT_ASSERT_EQUAL(uint64_t(17), diff.size());
CPPUNIT_ASSERT_EQUAL(size_t(17), diff.size());
CPPUNIT_ASSERT_EQUAL(uint16_t(1), cmd2.getAddress()->getIndex());
CPPUNIT_ASSERT_EQUAL(uint16_t(1234), cmd2.getSourceIndex());

Expand All @@ -300,15 +300,15 @@ MergeHandlerTest::testGetBucketDiffChain(bool midChain)

if (midChain) {
LOG(info, "Check state");
CPPUNIT_ASSERT_EQUAL(uint64_t(1), messageKeeper()._msgs.size());
CPPUNIT_ASSERT_EQUAL(size_t(1), messageKeeper()._msgs.size());
CPPUNIT_ASSERT_EQUAL(api::MessageType::GETBUCKETDIFF,
messageKeeper()._msgs[0]->getType());
api::GetBucketDiffCommand& cmd2(
dynamic_cast<api::GetBucketDiffCommand&>(
*messageKeeper()._msgs[0]));
CPPUNIT_ASSERT_EQUAL(_nodes, cmd2.getNodes());
std::vector<api::GetBucketDiffCommand::Entry> diff(cmd2.getDiff());
CPPUNIT_ASSERT_EQUAL(uint64_t(17), diff.size());
CPPUNIT_ASSERT_EQUAL(size_t(17), diff.size());
CPPUNIT_ASSERT_EQUAL(uint16_t(1), cmd2.getAddress()->getIndex());

LOG(info, "Verifying that replying the diff sends on back");
Expand All @@ -328,7 +328,7 @@ MergeHandlerTest::testGetBucketDiffChain(bool midChain)

CPPUNIT_ASSERT_EQUAL(_nodes, reply2->getNodes());
std::vector<api::GetBucketDiffCommand::Entry> diff(reply2->getDiff());
CPPUNIT_ASSERT_EQUAL(uint64_t(17), diff.size());
CPPUNIT_ASSERT_EQUAL(size_t(17), diff.size());
}

void
Expand All @@ -344,15 +344,15 @@ MergeHandlerTest::testApplyBucketDiffChain(bool midChain)

if (midChain) {
LOG(info, "Check state");
CPPUNIT_ASSERT_EQUAL(uint64_t(1), messageKeeper()._msgs.size());
CPPUNIT_ASSERT_EQUAL(size_t(1), messageKeeper()._msgs.size());
CPPUNIT_ASSERT_EQUAL(api::MessageType::APPLYBUCKETDIFF,
messageKeeper()._msgs[0]->getType());
api::ApplyBucketDiffCommand& cmd2(
dynamic_cast<api::ApplyBucketDiffCommand&>(
*messageKeeper()._msgs[0]));
CPPUNIT_ASSERT_EQUAL(_nodes, cmd2.getNodes());
std::vector<api::ApplyBucketDiffCommand::Entry> diff(cmd2.getDiff());
CPPUNIT_ASSERT_EQUAL(uint64_t(0), diff.size());
CPPUNIT_ASSERT_EQUAL(size_t(0), diff.size());
CPPUNIT_ASSERT_EQUAL(uint16_t(1), cmd2.getAddress()->getIndex());

CPPUNIT_ASSERT(!replySent.get());
Expand All @@ -373,7 +373,7 @@ MergeHandlerTest::testApplyBucketDiffChain(bool midChain)

CPPUNIT_ASSERT_EQUAL(_nodes, reply2->getNodes());
std::vector<api::ApplyBucketDiffCommand::Entry> diff(reply2->getDiff());
CPPUNIT_ASSERT_EQUAL(uint64_t(0), diff.size());
CPPUNIT_ASSERT_EQUAL(size_t(0), diff.size());
}

void
Expand All @@ -386,7 +386,7 @@ MergeHandlerTest::testMasterMessageFlow()

handler.handleMergeBucket(cmd, *_context);
LOG(info, "Check state");
CPPUNIT_ASSERT_EQUAL(uint64_t(1), messageKeeper()._msgs.size());
CPPUNIT_ASSERT_EQUAL(size_t(1), messageKeeper()._msgs.size());
CPPUNIT_ASSERT_EQUAL(api::MessageType::GETBUCKETDIFF,
messageKeeper()._msgs[0]->getType());
api::GetBucketDiffCommand& cmd2(dynamic_cast<api::GetBucketDiffCommand&>(
Expand All @@ -400,7 +400,7 @@ MergeHandlerTest::testMasterMessageFlow()
handler.handleGetBucketDiffReply(*reply, messageKeeper());

LOG(info, "Check state");
CPPUNIT_ASSERT_EQUAL(uint64_t(2), messageKeeper()._msgs.size());
CPPUNIT_ASSERT_EQUAL(size_t(2), messageKeeper()._msgs.size());
CPPUNIT_ASSERT_EQUAL(api::MessageType::APPLYBUCKETDIFF,
messageKeeper()._msgs[1]->getType());
api::ApplyBucketDiffCommand& cmd3(
Expand Down
6 changes: 3 additions & 3 deletions storage/src/tests/visiting/visitortest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ VisitorTest::testNormalUsage()

verifyCreateVisitorReply(api::ReturnCode::OK);
CPPUNIT_ASSERT(waitUntilNoActiveVisitors());
CPPUNIT_ASSERT_EQUAL(0L, getFailedVisitorDestinationReplyCount());
CPPUNIT_ASSERT_EQUAL(INT64_C(0), getFailedVisitorDestinationReplyCount());
}

void
Expand Down Expand Up @@ -668,7 +668,7 @@ VisitorTest::testNoDocumentAPIResendingForFailedVisitor()

verifyCreateVisitorReply(api::ReturnCode::NOT_CONNECTED);
CPPUNIT_ASSERT(waitUntilNoActiveVisitors());
CPPUNIT_ASSERT_EQUAL(3L, getFailedVisitorDestinationReplyCount());
CPPUNIT_ASSERT_EQUAL(INT64_C(3), getFailedVisitorDestinationReplyCount());
}

void
Expand Down Expand Up @@ -742,7 +742,7 @@ VisitorTest::testFailedDocumentAPISend()
CPPUNIT_ASSERT(waitUntilNoActiveVisitors());
// We currently don't count failures to send in this metric; send failures
// indicate a message bus problem and already log a warning when they happen
CPPUNIT_ASSERT_EQUAL(0L, getFailedVisitorDestinationReplyCount());
CPPUNIT_ASSERT_EQUAL(INT64_C(0), getFailedVisitorDestinationReplyCount());
}

void
Expand Down