MB-24034: VBucketTest: addOne/setOne to return Add/MutationStatus 85/77185/4
authorDave Rigby <daver@couchbase.com>
Fri, 21 Apr 2017 15:36:11 +0000 (16:36 +0100)
committerManu Dhundi <manu@couchbase.com>
Tue, 25 Apr 2017 17:01:45 +0000 (17:01 +0000)
commit02b3ab74ea6f5f9603bd960a9466c68da0c94afa
tree7436f0df152498f4551b36d33c25ad7f822dcb38
parent61e49f8442e80320ef78e95e64def5408f01c2bb
MB-24034: VBucketTest: addOne/setOne to return Add/MutationStatus

Change VBucketTest::addOne() & setOne() to return the result of the
operation, instead of passing in the expected value and having the
function itself (addOne/setOne) check it.

This was done for two reasons:

1. Sometimes addOne() is used in setup code, where an ASSERT_EQ() is
   more appropriate to check the result.

2. If the EXPECT does fail, then in the previous code the GTest error
   message would point at the implementation of addOne(), which
   generally isn't very helpful - normally you want to see the
   call-site of addOne.

Change-Id: Id478fdf2a96002503b75d6bd40edb62d869d46bc
Reviewed-on: http://review.couchbase.org/77185
Reviewed-by: Manu Dhundi <manu@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
tests/module_tests/ephemeral_vb_test.cc
tests/module_tests/vbucket_test.cc
tests/module_tests/vbucket_test.h