Skip to content

Commit

Permalink
unittest: add an assert for chain_listxattr.
Browse files Browse the repository at this point in the history
As there is no assert after chain_listxattr(), and memset actual to '\0'
immediately, we did not test chain_listxattr() at all.

This patch add an assert to do the unittest for chain_listxattr().

Signed-off-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
  • Loading branch information
yangdongsheng committed Mar 24, 2016
1 parent 0365bb9 commit a2c9356
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/test/objectstore/chain_xattr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ TEST(chain_xattr, listxattr) {
char* actual = (char*)calloc(1, buffer_size);
ASSERT_LT(buffer_size, chain_listxattr(file, NULL, 0)); // size evaluation is conservative
chain_listxattr(file, actual, buffer_size);
ASSERT_EQ(0, ::memcmp(expected, actual, buffer_size));
::memset(actual, '\0', buffer_size);
chain_flistxattr(fd, actual, buffer_size);
ASSERT_EQ(0, ::memcmp(expected, actual, buffer_size));
Expand Down

0 comments on commit a2c9356

Please sign in to comment.