From 66de7bd8cc62280483d3fe488b8fc5d2de0b9609 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 3 May 2019 01:29:55 +0800 Subject: [PATCH] test: do not conditionize on GTEST_HAS_PARAM_TEST value-parameterized is supported on all platforms, so drop this check Signed-off-by: Kefu Chai --- src/test/msgr/test_async_driver.cc | 15 --------------- src/test/msgr/test_async_networkstack.cc | 15 --------------- src/test/msgr/test_msgr.cc | 15 --------------- src/test/objectstore/Allocator_bench.cc | 7 ------- src/test/objectstore/Allocator_test.cc | 7 ------- src/test/objectstore/store_test.cc | 14 -------------- src/test/objectstore/test_kv.cc | 14 -------------- 7 files changed, 87 deletions(-) diff --git a/src/test/msgr/test_async_driver.cc b/src/test/msgr/test_async_driver.cc index f15c37d9e41c2..8b0f329ab24b4 100644 --- a/src/test/msgr/test_async_driver.cc +++ b/src/test/msgr/test_async_driver.cc @@ -59,8 +59,6 @@ #include -#if GTEST_HAS_PARAM_TEST - class EventDriverTest : public ::testing::TestWithParam { public: EventDriver *driver; @@ -346,19 +344,6 @@ INSTANTIATE_TEST_SUITE_P( ) ); -#else - -// Google Test may not support value-parameterized tests with some -// compilers. If we use conditional compilation to compile out all -// code referring to the gtest_main library, MSVC linker will not link -// that library at all and consequently complain about missing entry -// point defined in that library (fatal error LNK1561: entry point -// must be defined). This dummy test keeps gtest_main linked in. -TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {} - -#endif - - /* * Local Variables: * compile-command: "cd ../.. ; make ceph_test_async_driver && diff --git a/src/test/msgr/test_async_networkstack.cc b/src/test/msgr/test_async_networkstack.cc index 0cc7e351a1a57..3077c1f13e663 100644 --- a/src/test/msgr/test_async_networkstack.cc +++ b/src/test/msgr/test_async_networkstack.cc @@ -31,8 +31,6 @@ #include "msg/async/Stack.h" -#if GTEST_HAS_PARAM_TEST - class NoopConfigObserver : public md_config_obs_t { std::list options; const char **ptrs = 0; @@ -1077,19 +1075,6 @@ INSTANTIATE_TEST_SUITE_P( ) ); -#else - -// Google Test may not support value-parameterized tests with some -// compilers. If we use conditional compilation to compile out all -// code referring to the gtest_main library, MSVC linker will not link -// that library at all and consequently complain about missing entry -// point defined in that library (fatal error LNK1561: entry point -// must be defined). This dummy test keeps gtest_main linked in. -TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {} - -#endif - - /* * Local Variables: * compile-command: "cd ../.. ; make ceph_test_async_networkstack && diff --git a/src/test/msgr/test_msgr.cc b/src/test/msgr/test_msgr.cc index 4818b4c9f53f8..dd4c52c010ab2 100644 --- a/src/test/msgr/test_msgr.cc +++ b/src/test/msgr/test_msgr.cc @@ -50,8 +50,6 @@ typedef boost::mt11213b gen_type; #define dout_prefix *_dout << " ceph_test_msgr " -#if GTEST_HAS_PARAM_TEST - #define CHECK_AND_WAIT_TRUE(expr) do { \ int n = 1000; \ while (--n) { \ @@ -2221,19 +2219,6 @@ INSTANTIATE_TEST_SUITE_P( ) ); -#else - -// Google Test may not support value-parameterized tests with some -// compilers. If we use conditional compilation to compile out all -// code referring to the gtest_main library, MSVC linker will not link -// that library at all and consequently complain about missing entry -// point defined in that library (fatal error LNK1561: entry point -// must be defined). This dummy test keeps gtest_main linked in. -TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {} - -#endif - - int main(int argc, char **argv) { vector args; argv_to_vec(argc, (const char **)argv, args); diff --git a/src/test/objectstore/Allocator_bench.cc b/src/test/objectstore/Allocator_bench.cc index bd030df701ca2..50fbb1e410ac1 100755 --- a/src/test/objectstore/Allocator_bench.cc +++ b/src/test/objectstore/Allocator_bench.cc @@ -22,8 +22,6 @@ typedef boost::mt11213b gen_type; #define dout_context g_ceph_context #define dout_subsys ceph_subsys_ -#if GTEST_HAS_PARAM_TEST - class AllocTest : public ::testing::TestWithParam { public: @@ -333,8 +331,3 @@ INSTANTIATE_TEST_SUITE_P( Allocator, AllocTest, ::testing::Values("stupid", "bitmap")); - -#else - -TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {} -#endif diff --git a/src/test/objectstore/Allocator_test.cc b/src/test/objectstore/Allocator_test.cc index 5c579103c5337..1bf3a7d2dd031 100644 --- a/src/test/objectstore/Allocator_test.cc +++ b/src/test/objectstore/Allocator_test.cc @@ -18,8 +18,6 @@ #include typedef boost::mt11213b gen_type; -#if GTEST_HAS_PARAM_TEST - class AllocTest : public ::testing::TestWithParam { public: @@ -332,8 +330,3 @@ INSTANTIATE_TEST_SUITE_P( Allocator, AllocTest, ::testing::Values("stupid", "bitmap")); - -#else - -TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {} -#endif diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index ddd54c149b156..bb22c7038e111 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -48,8 +48,6 @@ typedef boost::mt11213b gen_type; const uint64_t DEF_STORE_TEST_BLOCKDEV_SIZE = 10240000000; #define dout_context g_ceph_context -#if GTEST_HAS_PARAM_TEST - static bool bl_eq(bufferlist& expected, bufferlist& actual) { if (expected.contents_equal(actual)) @@ -6211,18 +6209,6 @@ INSTANTIATE_TEST_SUITE_P( #endif "kstore")); -#else - -// Google Test may not support value-parameterized tests with some -// compilers. If we use conditional compilation to compile out all -// code referring to the gtest_main library, MSVC linker will not link -// that library at all and consequently complain about missing entry -// point defined in that library (fatal error LNK1561: entry point -// must be defined). This dummy test keeps gtest_main linked in. -TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {} - -#endif - void doMany4KWritesTest(boost::scoped_ptr& store, unsigned max_objects, unsigned max_ops, diff --git a/src/test/objectstore/test_kv.cc b/src/test/objectstore/test_kv.cc index fe2560e63417c..16881bcb044cc 100644 --- a/src/test/objectstore/test_kv.cc +++ b/src/test/objectstore/test_kv.cc @@ -27,8 +27,6 @@ #include "include/stringify.h" #include -#if GTEST_HAS_PARAM_TEST - class KVTest : public ::testing::TestWithParam { public: boost::scoped_ptr db; @@ -472,18 +470,6 @@ INSTANTIATE_TEST_SUITE_P( KVTest, ::testing::Values("leveldb", "rocksdb", "memdb")); -#else - -// Google Test may not support value-parameterized tests with some -// compilers. If we use conditional compilation to compile out all -// code referring to the gtest_main library, MSVC linker will not link -// that library at all and consequently complain about missing entry -// point defined in that library (fatal error LNK1561: entry point -// must be defined). This dummy test keeps gtest_main linked in. -TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {} - -#endif - int main(int argc, char **argv) { vector args; argv_to_vec(argc, (const char **)argv, args); -- 2.39.5