From: Kefu Chai Date: Thu, 22 Sep 2016 05:46:54 +0000 (+0800) Subject: ceph_test_objectstore: fail the test if SetUp() fails X-Git-Tag: v11.0.1~117^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=afac9345fd54e9ff69bdeefe4557d8235c4e3960;p=ceph.git ceph_test_objectstore: fail the test if SetUp() fails so it will issues a fatal error if anything goes wrong, instead of continuing with the test cases. Signed-off-by: Kefu Chai --- diff --git a/src/test/objectstore/store_test_fixture.cc b/src/test/objectstore/store_test_fixture.cc index 7f2069ada15d..66bd37c6a042 100644 --- a/src/test/objectstore/store_test_fixture.cc +++ b/src/test/objectstore/store_test_fixture.cc @@ -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() {