Skip to content

Commit

Permalink
test: do not conditionize on GTEST_HAS_PARAM_TEST
Browse files Browse the repository at this point in the history
value-parameterized is supported on all platforms, so drop this check

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed May 2, 2019
1 parent 71f5f3e commit 66de7bd
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 87 deletions.
15 changes: 0 additions & 15 deletions src/test/msgr/test_async_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
#include <gtest/gtest.h>


#if GTEST_HAS_PARAM_TEST

class EventDriverTest : public ::testing::TestWithParam<const char*> {
public:
EventDriver *driver;
Expand Down Expand Up @@ -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 &&
Expand Down
15 changes: 0 additions & 15 deletions src/test/msgr/test_async_networkstack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
#include "msg/async/Stack.h"


#if GTEST_HAS_PARAM_TEST

class NoopConfigObserver : public md_config_obs_t {
std::list<std::string> options;
const char **ptrs = 0;
Expand Down Expand Up @@ -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 &&
Expand Down
15 changes: 0 additions & 15 deletions src/test/msgr/test_msgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) { \
Expand Down Expand Up @@ -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<const char*> args;
argv_to_vec(argc, (const char **)argv, args);
Expand Down
7 changes: 0 additions & 7 deletions src/test/objectstore/Allocator_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<const char*> {

public:
Expand Down Expand Up @@ -333,8 +331,3 @@ INSTANTIATE_TEST_SUITE_P(
Allocator,
AllocTest,
::testing::Values("stupid", "bitmap"));

#else

TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
#endif
7 changes: 0 additions & 7 deletions src/test/objectstore/Allocator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#include <boost/random/uniform_int.hpp>
typedef boost::mt11213b gen_type;

#if GTEST_HAS_PARAM_TEST

class AllocTest : public ::testing::TestWithParam<const char*> {

public:
Expand Down Expand Up @@ -332,8 +330,3 @@ INSTANTIATE_TEST_SUITE_P(
Allocator,
AllocTest,
::testing::Values("stupid", "bitmap"));

#else

TEST(DummyTest, ValueParameterizedTestsAreNotSupportedOnThisPlatform) {}
#endif
14 changes: 0 additions & 14 deletions src/test/objectstore/store_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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<ObjectStore>& store,
unsigned max_objects,
unsigned max_ops,
Expand Down
14 changes: 0 additions & 14 deletions src/test/objectstore/test_kv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
#include "include/stringify.h"
#include <gtest/gtest.h>

#if GTEST_HAS_PARAM_TEST

class KVTest : public ::testing::TestWithParam<const char*> {
public:
boost::scoped_ptr<KeyValueDB> db;
Expand Down Expand Up @@ -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<const char*> args;
argv_to_vec(argc, (const char **)argv, args);
Expand Down

0 comments on commit 66de7bd

Please sign in to comment.