}
+TEST_P(StoreTest, ZeroLengthWrite) {
+ ObjectStore::Sequencer osr("test");
+ int r;
+ coll_t cid;
+ ghobject_t hoid(hobject_t(sobject_t("foo", CEPH_NOSNAP)));
+ {
+ ObjectStore::Transaction t;
+ t.create_collection(cid, 0);
+ t.touch(cid, hoid);
+ r = apply_transaction(store, &osr, std::move(t));
+ ASSERT_EQ(r, 0);
+ }
+ {
+ ObjectStore::Transaction t;
+ bufferlist empty;
+ t.write(cid, hoid, 1048576, 0, empty);
+ r = apply_transaction(store, &osr, std::move(t));
+ ASSERT_EQ(r, 0);
+ }
+ struct stat stat;
+ r = store->stat(cid, hoid, &stat);
+ ASSERT_EQ(0, r);
+ ASSERT_EQ(0, stat.st_size);
+}
+
TEST_P(StoreTest, SimpleAttrTest) {
ObjectStore::Sequencer osr("test");
int r;