]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/objectstore: add test cache "offset=length=0". 7957/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Tue, 15 Mar 2016 09:11:38 +0000 (17:11 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Tue, 15 Mar 2016 09:11:38 +0000 (17:11 +0800)
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/test/objectstore/store_test.cc

index 36cb2aeb808929ab94333c6b58def558b082d1f2..f9396c439d17dce42899091ebe0ad5b85ecaa318 100644 (file)
@@ -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);