aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2020-03-28 23:33:03 +0100
committerTor Egge <Tor.Egge@broadpark.no>2020-03-29 17:56:55 +0200
commit463b515efa427bb031e6b83047050084f94008a4 (patch)
treeeace270f599ab41f93ff5db6ae60a138ef68da75 /searchlib/src
parent49bbb07870e221e6c38b2b7955985c5f3f5518ed (diff)
Handle newer gtest versions where the legacy API is deprecated.
Diffstat (limited to 'searchlib/src')
-rw-r--r--searchlib/src/tests/attribute/enum_attribute_compaction/enum_attribute_compaction_test.cpp8
-rw-r--r--searchlib/src/tests/attribute/enumstore/enumstore_test.cpp8
-rw-r--r--searchlib/src/tests/memoryindex/field_index/field_index_test.cpp4
3 files changed, 20 insertions, 0 deletions
diff --git a/searchlib/src/tests/attribute/enum_attribute_compaction/enum_attribute_compaction_test.cpp b/searchlib/src/tests/attribute/enum_attribute_compaction/enum_attribute_compaction_test.cpp
index 31af5945337..3ea2ce73700 100644
--- a/searchlib/src/tests/attribute/enum_attribute_compaction/enum_attribute_compaction_test.cpp
+++ b/searchlib/src/tests/attribute/enum_attribute_compaction/enum_attribute_compaction_test.cpp
@@ -221,7 +221,11 @@ TEST_P(IntegerCompactionTest, compact)
test_enum_store_compaction();
}
+#ifdef INSTANTIATE_TEST_SUITE_P
+INSTANTIATE_TEST_SUITE_P(IntegerCompactionTestSet, IntegerCompactionTest, ::testing::Values(CollectionType::SINGLE, CollectionType::ARRAY, CollectionType::WSET));
+#else
INSTANTIATE_TEST_CASE_P(IntegerCompactionTestSet, IntegerCompactionTest, ::testing::Values(CollectionType::SINGLE, CollectionType::ARRAY, CollectionType::WSET));
+#endif
using StringCompactionTest = CompactionTest<StringAttribute>;
@@ -230,6 +234,10 @@ TEST_P(StringCompactionTest, compact)
test_enum_store_compaction();
}
+#ifdef INSTANTIATE_TEST_SUITE_P
+INSTANTIATE_TEST_SUITE_P(StringCompactionTestSet, StringCompactionTest, ::testing::Values(CollectionType::SINGLE, CollectionType::ARRAY, CollectionType::WSET));
+#else
INSTANTIATE_TEST_CASE_P(StringCompactionTestSet, StringCompactionTest, ::testing::Values(CollectionType::SINGLE, CollectionType::ARRAY, CollectionType::WSET));
+#endif
GTEST_MAIN_RUN_ALL_TESTS()
diff --git a/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp b/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp
index 3a885dda233..bec6896d4d7 100644
--- a/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp
+++ b/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp
@@ -72,7 +72,11 @@ public:
#endif
using FloatEnumStoreTestTypes = ::testing::Types<FloatEnumStore, DoubleEnumStore>;
+#ifdef TYPED_TEST_SUITE
+TYPED_TEST_SUITE(FloatEnumStoreTest, FloatEnumStoreTestTypes);
+#else
TYPED_TEST_CASE(FloatEnumStoreTest, FloatEnumStoreTestTypes);
+#endif
TYPED_TEST(FloatEnumStoreTest, numbers_can_be_inserted_and_retrieved)
{
@@ -452,7 +456,11 @@ LoaderTest<StringEnumStore>::load_values(enumstore::EnumeratedLoaderBase& loader
#endif
using LoaderTestTypes = ::testing::Types<NumericEnumStore, FloatEnumStore, StringEnumStore>;
+#ifdef TYPED_TEST_SUITE
+TYPED_TEST_SUITE(LoaderTest, LoaderTestTypes);
+#else
TYPED_TEST_CASE(LoaderTest, LoaderTestTypes);
+#endif
TYPED_TEST(LoaderTest, store_is_instantiated_with_enumerated_loader)
{
diff --git a/searchlib/src/tests/memoryindex/field_index/field_index_test.cpp b/searchlib/src/tests/memoryindex/field_index/field_index_test.cpp
index c562c0cf29c..c44fffc1d48 100644
--- a/searchlib/src/tests/memoryindex/field_index/field_index_test.cpp
+++ b/searchlib/src/tests/memoryindex/field_index/field_index_test.cpp
@@ -517,7 +517,11 @@ struct FieldIndexTest : public ::testing::Test {
};
using FieldIndexTestTypes = ::testing::Types<FieldIndex<false>, FieldIndex<true>>;
+#ifdef TYPED_TEST_SUITE
+TYPED_TEST_SUITE(FieldIndexTest, FieldIndexTestTypes);
+#else
TYPED_TEST_CASE(FieldIndexTest, FieldIndexTestTypes);
+#endif
// Disable warnings emitted by gtest generated files when using typed tests
#pragma GCC diagnostic push