From: Danny Al-Gaaf Date: Thu, 30 Oct 2014 02:57:16 +0000 (+0100) Subject: test/librados/c_read_operations.cc: fix invalid checks X-Git-Tag: v0.89~22^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a4cecda7cc9c641acbc261d3f31664631b575950;p=ceph.git test/librados/c_read_operations.cc: fix invalid checks Wrong variable for return of rados_getxattrs_next() and rados_omap_get_next() used (len vs. val_len). Fix for: CID 1219464 (#1 of 1): Logically dead code (DEADCODE) dead_error_line: Execution cannot reach this expression key == NULL inside statement if (len == 0UL && key == NU... CID 1219465 (#1 of 1): Logically dead code (DEADCODE) dead_error_line: Execution cannot reach this expression key == NULL inside statement if (len == 0UL && key == NU... Signed-off-by: Danny Al-Gaaf --- diff --git a/src/test/librados/c_read_operations.cc b/src/test/librados/c_read_operations.cc index 3ca31f4ce42e..33a4675f2e28 100644 --- a/src/test/librados/c_read_operations.cc +++ b/src/test/librados/c_read_operations.cc @@ -70,7 +70,7 @@ protected: size_t val_len = 0; while (i < len) { ASSERT_EQ(0, rados_omap_get_next(iter, &key, &val, &val_len)); - if (len == 0 && key == NULL && val == NULL) + if (val_len == 0 && key == NULL && val == NULL) break; if (key) EXPECT_EQ(std::string(keys[i]), std::string(key)); @@ -101,7 +101,7 @@ protected: while (i < len) { ASSERT_EQ(0, rados_getxattrs_next(iter, (const char**) &key, (const char**) &val, &val_len)); - if (len == 0 && key == NULL && val == NULL) + if (val_len == 0 && key == NULL && val == NULL) break; EXPECT_EQ(std::string(keys[i]), std::string(key)); EXPECT_EQ(0, memcmp(vals[i], val, val_len));