summaryrefslogtreecommitdiff
path: root/db/write_batch_test.cc
diff options
context:
space:
mode:
authorWilfried Goesgens <willi@arangodb.com>2019-09-09 11:22:28 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2019-09-09 11:24:11 -0700
commitfbab9913e241fb618ace06613e65242c5cd045e3 (patch)
treeba2297330a7dbc854165635f491557bc73a8db4c /db/write_batch_test.cc
parentadbc25a4c8cfb7ddebc7de017c89de64526e777b (diff)
upgrade gtest 1.7.0 => 1.8.1 for json result writing
Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/5332 Differential Revision: D17242232 fbshipit-source-id: c0d4646556a1335e51ac7382b986ca7f6ced7b64
Diffstat (limited to 'db/write_batch_test.cc')
-rw-r--r--db/write_batch_test.cc44
1 files changed, 22 insertions, 22 deletions
diff --git a/db/write_batch_test.cc b/db/write_batch_test.cc
index 6a3f9e680..869cfa8cb 100644
--- a/db/write_batch_test.cc
+++ b/db/write_batch_test.cc
@@ -37,7 +37,7 @@ static std::string PrintContents(WriteBatch* b) {
ColumnFamilyMemTablesDefault cf_mems_default(mem);
Status s =
WriteBatchInternal::InsertInto(b, &cf_mems_default, nullptr, nullptr);
- int count = 0;
+ uint32_t count = 0;
int put_count = 0;
int delete_count = 0;
int single_delete_count = 0;
@@ -132,8 +132,8 @@ class WriteBatchTest : public testing::Test {};
TEST_F(WriteBatchTest, Empty) {
WriteBatch batch;
ASSERT_EQ("", PrintContents(&batch));
- ASSERT_EQ(0, WriteBatchInternal::Count(&batch));
- ASSERT_EQ(0, batch.Count());
+ ASSERT_EQ(0u, WriteBatchInternal::Count(&batch));
+ ASSERT_EQ(0u, batch.Count());
}
TEST_F(WriteBatchTest, Multiple) {
@@ -144,14 +144,14 @@ TEST_F(WriteBatchTest, Multiple) {
batch.Put(Slice("baz"), Slice("boo"));
WriteBatchInternal::SetSequence(&batch, 100);
ASSERT_EQ(100U, WriteBatchInternal::Sequence(&batch));
- ASSERT_EQ(4, WriteBatchInternal::Count(&batch));
+ ASSERT_EQ(4u, WriteBatchInternal::Count(&batch));
ASSERT_EQ(
"Put(baz, boo)@103"
"Delete(box)@101"
"Put(foo, bar)@100"
"DeleteRange(bar, foo)@102",
PrintContents(&batch));
- ASSERT_EQ(4, batch.Count());
+ ASSERT_EQ(4u, batch.Count());
}
TEST_F(WriteBatchTest, Corruption) {
@@ -174,19 +174,19 @@ TEST_F(WriteBatchTest, Append) {
WriteBatchInternal::Append(&b1, &b2);
ASSERT_EQ("",
PrintContents(&b1));
- ASSERT_EQ(0, b1.Count());
+ ASSERT_EQ(0u, b1.Count());
b2.Put("a", "va");
WriteBatchInternal::Append(&b1, &b2);
ASSERT_EQ("Put(a, va)@200",
PrintContents(&b1));
- ASSERT_EQ(1, b1.Count());
+ ASSERT_EQ(1u, b1.Count());
b2.Clear();
b2.Put("b", "vb");
WriteBatchInternal::Append(&b1, &b2);
ASSERT_EQ("Put(a, va)@200"
"Put(b, vb)@201",
PrintContents(&b1));
- ASSERT_EQ(2, b1.Count());
+ ASSERT_EQ(2u, b1.Count());
b2.Delete("foo");
WriteBatchInternal::Append(&b1, &b2);
ASSERT_EQ("Put(a, va)@200"
@@ -194,7 +194,7 @@ TEST_F(WriteBatchTest, Append) {
"Put(b, vb)@201"
"Delete(foo)@203",
PrintContents(&b1));
- ASSERT_EQ(4, b1.Count());
+ ASSERT_EQ(4u, b1.Count());
b2.Clear();
b2.Put("c", "cc");
b2.Put("d", "dd");
@@ -209,29 +209,29 @@ TEST_F(WriteBatchTest, Append) {
"Put(d, dd)@205"
"Delete(foo)@203",
PrintContents(&b1));
- ASSERT_EQ(6, b1.Count());
+ ASSERT_EQ(6u, b1.Count());
ASSERT_EQ(
"Put(c, cc)@0"
"Put(d, dd)@1"
"Put(e, ee)@2",
PrintContents(&b2));
- ASSERT_EQ(3, b2.Count());
+ ASSERT_EQ(3u, b2.Count());
}
TEST_F(WriteBatchTest, SingleDeletion) {
WriteBatch batch;
WriteBatchInternal::SetSequence(&batch, 100);
ASSERT_EQ("", PrintContents(&batch));
- ASSERT_EQ(0, batch.Count());
+ ASSERT_EQ(0u, batch.Count());
batch.Put("a", "va");
ASSERT_EQ("Put(a, va)@100", PrintContents(&batch));
- ASSERT_EQ(1, batch.Count());
+ ASSERT_EQ(1u, batch.Count());
batch.SingleDelete("a");
ASSERT_EQ(
"SingleDelete(a)@101"
"Put(a, va)@100",
PrintContents(&batch));
- ASSERT_EQ(2, batch.Count());
+ ASSERT_EQ(2u, batch.Count());
}
namespace {
@@ -317,7 +317,7 @@ namespace {
TEST_F(WriteBatchTest, PutNotImplemented) {
WriteBatch batch;
batch.Put(Slice("k1"), Slice("v1"));
- ASSERT_EQ(1, batch.Count());
+ ASSERT_EQ(1u, batch.Count());
ASSERT_EQ("Put(k1, v1)@0", PrintContents(&batch));
WriteBatch::Handler handler;
@@ -327,7 +327,7 @@ TEST_F(WriteBatchTest, PutNotImplemented) {
TEST_F(WriteBatchTest, DeleteNotImplemented) {
WriteBatch batch;
batch.Delete(Slice("k2"));
- ASSERT_EQ(1, batch.Count());
+ ASSERT_EQ(1u, batch.Count());
ASSERT_EQ("Delete(k2)@0", PrintContents(&batch));
WriteBatch::Handler handler;
@@ -337,7 +337,7 @@ TEST_F(WriteBatchTest, DeleteNotImplemented) {
TEST_F(WriteBatchTest, SingleDeleteNotImplemented) {
WriteBatch batch;
batch.SingleDelete(Slice("k2"));
- ASSERT_EQ(1, batch.Count());
+ ASSERT_EQ(1u, batch.Count());
ASSERT_EQ("SingleDelete(k2)@0", PrintContents(&batch));
WriteBatch::Handler handler;
@@ -347,7 +347,7 @@ TEST_F(WriteBatchTest, SingleDeleteNotImplemented) {
TEST_F(WriteBatchTest, MergeNotImplemented) {
WriteBatch batch;
batch.Merge(Slice("foo"), Slice("bar"));
- ASSERT_EQ(1, batch.Count());
+ ASSERT_EQ(1u, batch.Count());
ASSERT_EQ("Merge(foo, bar)@0", PrintContents(&batch));
WriteBatch::Handler handler;
@@ -364,7 +364,7 @@ TEST_F(WriteBatchTest, Blob) {
batch.SingleDelete(Slice("k3"));
batch.PutLogData(Slice("blob2"));
batch.Merge(Slice("foo"), Slice("bar"));
- ASSERT_EQ(6, batch.Count());
+ ASSERT_EQ(6u, batch.Count());
ASSERT_EQ(
"Merge(foo, bar)@5"
"Put(k1, v1)@0"
@@ -399,7 +399,7 @@ TEST_F(WriteBatchTest, PrepareCommit) {
ASSERT_EQ(s, Status::NotFound());
WriteBatchInternal::MarkCommit(&batch, Slice("xid1"));
WriteBatchInternal::MarkRollback(&batch, Slice("xid1"));
- ASSERT_EQ(2, batch.Count());
+ ASSERT_EQ(2u, batch.Count());
TestHandler handler;
batch.Iterate(&handler);
@@ -489,7 +489,7 @@ TEST_F(WriteBatchTest, DISABLED_LargeKeyValue) {
batch.Put(raw, raw);
}
- ASSERT_EQ(2, batch.Count());
+ ASSERT_EQ(2u, batch.Count());
struct NoopHandler : public WriteBatch::Handler {
int num_seen = 0;
@@ -600,7 +600,7 @@ TEST_F(WriteBatchTest, PutGatherSlices) {
"Put(foo, bar)@100"
"Put(keypart2part3, value)@102",
PrintContents(&batch));
- ASSERT_EQ(3, batch.Count());
+ ASSERT_EQ(3u, batch.Count());
}
namespace {