From 1785f917cd6d95b50f60e664c2c874ce3a379dec Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Tue, 15 Mar 2016 17:11:38 +0800 Subject: [PATCH] test/objectstore: add test cache "offset=length=0". Signed-off-by: Jianpeng Ma --- src/test/objectstore/store_test.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 36cb2aeb8089..f9396c439d17 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -525,6 +525,17 @@ TEST_P(StoreTest, SimpleObjectTest) { in.hexdump(cout); ASSERT_TRUE(in.contents_equal(bl)); } + { + bufferlist bl; + bl.append("abcde01234012340123401234abcde01234012340123401234abcde01234012340123401234abcde01234012340123401234"); + + //test: offset=len=0 mean read all data + bufferlist in; + r = store->read(cid, hoid, 0, 0, in); + ASSERT_EQ((int)bl.length(), r); + in.hexdump(cout); + ASSERT_TRUE(in.contents_equal(bl)); + } { ObjectStore::Transaction t; t.remove(cid, hoid); -- 2.47.3