]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_test_objectstore: fail the test if SetUp() fails
authorKefu Chai <kchai@redhat.com>
Thu, 22 Sep 2016 05:46:54 +0000 (13:46 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 22 Sep 2016 07:45:35 +0000 (15:45 +0800)
so it will issues a fatal error if anything goes wrong, instead of continuing
with the test cases.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/objectstore/store_test_fixture.cc

index 7f2069ada15deca218bd791f6a222673996d1f8e..66bd37c6a04254a849f392d21e22ead5bfee7fe1 100644 (file)
@@ -22,8 +22,8 @@ void StoreTestFixture::SetUp() {
   if (r < 0) {
     r = -errno;
     cerr << __func__ << ": unable to create " << data_dir << ": " << cpp_strerror(r) << std::endl;
-    return;
   }
+  ASSERT_EQ(0, r);
 
   store.reset(ObjectStore::create(g_ceph_context,
                                   type,
@@ -31,10 +31,10 @@ void StoreTestFixture::SetUp() {
                                   string("store_test_temp_journal")));
   if (!store) {
     cerr << __func__ << ": objectstore type " << type << " doesn't exist yet!" << std::endl;
-    return;
   }
-  EXPECT_EQ(0, store->mkfs());
-  EXPECT_EQ(0, store->mount());
+  ASSERT_TRUE(store);
+  ASSERT_EQ(0, store->mkfs());
+  ASSERT_EQ(0, store->mount());
 }
 
 void StoreTestFixture::TearDown() {