From 64d2947e2f811dd155dcbbe51837fbdbc10f16e5 Mon Sep 17 00:00:00 2001 From: kzlin Date: Wed, 15 Apr 2026 03:32:42 +0000 Subject: [PATCH] [Fix]: fix assertion and error messages in test_correctness_minimal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In SingleNodePolling test, the Get() assertion was inverted: - Get() returns value length (>0) on success, negative error code on failure. The assertion `kv_ret < 0` incorrectly expected failure, causing the test to always fail when Get() succeeds (returns 3072 = data_size). - Fix: `kv_ret < 0` → `kv_ret > 0` - Also fix misleading error message strings for both Put and Get assertions to describe the expected (success) outcome. Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/correctness/test_correctness_minimal.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/correctness/test_correctness_minimal.cc b/tests/correctness/test_correctness_minimal.cc index e952923..488cde8 100644 --- a/tests/correctness/test_correctness_minimal.cc +++ b/tests/correctness/test_correctness_minimal.cc @@ -104,7 +104,7 @@ TEST_F(RAWMinimalTest, SingleNodePolling) { // PUT int32_t kv_ret = store_->Put(key, simm_data_view); - ASSERT_EQ(kv_ret, CommonErr::OK) << "Put operation failed with error code: " << kv_ret; + ASSERT_EQ(kv_ret, CommonErr::OK) << "Put should return OK, actual: " << kv_ret; MLOG_DEBUG("PUT Key: {}, Size: {}\n", key, data_size); // EXIST @@ -114,7 +114,7 @@ TEST_F(RAWMinimalTest, SingleNodePolling) { // GET auto got = store_->Allocate(data_size); kv_ret = store_->Get(key, got); - ASSERT_TRUE(kv_ret < 0) << "Get operation failed with error code: " << kv_ret; + ASSERT_TRUE(kv_ret > 0) << "Get should return value length > 0, actual: " << kv_ret; MLOG_DEBUG("GET Key: {}, Size: {}\n", key, data_size); // CHECK