diff options
author | Matt Benjamin <mbenjamin@redhat.com> | 2015-10-27 13:41:52 +0100 |
---|---|---|
committer | Matt Benjamin <mbenjamin@redhat.com> | 2016-02-12 18:05:13 +0100 |
commit | 7f981b10a2774d834fdb6599b06061dc2e60436b (patch) | |
tree | b56c111082f736a523b16b254ec3f8971a929e0f /src/test/librgw_file_gp.cc | |
parent | librgw: avoid illegal rele() (diff) | |
download | ceph-7f981b10a2774d834fdb6599b06061dc2e60436b.tar.xz ceph-7f981b10a2774d834fdb6599b06061dc2e60436b.zip |
librgw: fix rgw_open param names and invocation
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Diffstat (limited to 'src/test/librgw_file_gp.cc')
-rw-r--r-- | src/test/librgw_file_gp.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/test/librgw_file_gp.cc b/src/test/librgw_file_gp.cc index 2b73f4beef5..1f0da0f017f 100644 --- a/src/test/librgw_file_gp.cc +++ b/src/test/librgw_file_gp.cc @@ -44,7 +44,8 @@ namespace { string bucket_name = "sorry_dave"; string object_name = "jocaml"; - struct rgw_file_handle *fh = nullptr; + struct rgw_file_handle *bucket_fh = nullptr; + struct rgw_file_handle *object_fh = nullptr; std::uniform_int_distribution<uint8_t> uint_dist; std::mt19937 rng; @@ -137,17 +138,20 @@ TEST(LibRGW, MOUNT) { } TEST(LibRGW, OBJ_OPEN) { - int ret = rgw_lookup(fs, fs->root_fh, bucket_name.c_str(), &fh, + int ret = rgw_lookup(fs, fs->root_fh, bucket_name.c_str(), &bucket_fh, 0 /* flags */); ASSERT_EQ(ret, 0); - ret = rgw_open(fs, fh, 0 /* flags */); + ret = rgw_lookup(fs, bucket_fh, object_name.c_str(), &object_fh, + 0 /* flags */); + ASSERT_EQ(ret, 0); + ret = rgw_open(fs, object_fh, 0 /* flags */); ASSERT_EQ(ret, 0); } TEST(LibRGW, PUT_OBJECT) { if (do_put) { string data = "hi mom"; // fix this - int ret = rgw_write(fs, fh, 0, data.length(), (void*) data.c_str()); + int ret = rgw_write(fs, object_fh, 0, data.length(), (void*) data.c_str()); ASSERT_EQ(ret, 0); } } @@ -157,9 +161,11 @@ TEST(LibRGW, GET_OBJECT) { } TEST(LibRGW, CLEANUP) { - int ret = rgw_close(fs, fh, 0 /* flags */); + int ret = rgw_close(fs, object_fh, 0 /* flags */); + ASSERT_EQ(ret, 0); + ret = rgw_fh_rele(fs, object_fh, 0 /* flags */); ASSERT_EQ(ret, 0); - ret = rgw_fh_rele(fs, fh, 0 /* flags */); + ret = rgw_fh_rele(fs, bucket_fh, 0 /* flags */); ASSERT_EQ(ret, 0); } |