Update googletest from 1.8.1 to 1.10.0 (#6808)

Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/6808

Reviewed By: anand1976

Differential Revision: D21483984

Pulled By: pdillinger

fbshipit-source-id: 70c5eff2bd54ddba469761d95e4cd4611fb8e598
This commit is contained in:
Adam Retter 2020-06-01 20:31:29 -07:00 committed by Facebook GitHub Bot
parent 66942e8158
commit 8d87e9cea1
49 changed files with 5115 additions and 11985 deletions

View File

@ -523,7 +523,7 @@ endif()
include_directories(${PROJECT_SOURCE_DIR}) include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/include) include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third-party/gtest-1.8.1/fused-src) include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third-party/gtest-1.10.0/fused-src)
if(WITH_FOLLY_DISTRIBUTED_MUTEX) if(WITH_FOLLY_DISTRIBUTED_MUTEX)
include_directories(${PROJECT_SOURCE_DIR}/third-party/folly) include_directories(${PROJECT_SOURCE_DIR}/third-party/folly)
endif() endif()
@ -965,7 +965,7 @@ endif()
CMAKE_DEPENDENT_OPTION(WITH_TESTS "build with tests" ON CMAKE_DEPENDENT_OPTION(WITH_TESTS "build with tests" ON
"CMAKE_BUILD_TYPE STREQUAL Debug" OFF) "CMAKE_BUILD_TYPE STREQUAL Debug" OFF)
if(WITH_TESTS) if(WITH_TESTS)
add_subdirectory(third-party/gtest-1.8.1/fused-src/gtest) add_subdirectory(third-party/gtest-1.10.0/fused-src/gtest)
add_library(testharness STATIC add_library(testharness STATIC
test_util/testharness.cc) test_util/testharness.cc)
target_link_libraries(testharness gtest) target_link_libraries(testharness gtest)

View File

@ -329,7 +329,7 @@ endif
export GTEST_THROW_ON_FAILURE=1 export GTEST_THROW_ON_FAILURE=1
export GTEST_HAS_EXCEPTIONS=1 export GTEST_HAS_EXCEPTIONS=1
GTEST_DIR = third-party/gtest-1.8.1/fused-src GTEST_DIR = third-party/gtest-1.10.0/fused-src
# AIX: pre-defined system headers are surrounded by an extern "C" block # AIX: pre-defined system headers are surrounded by an extern "C" block
ifeq ($(PLATFORM), OS_AIX) ifeq ($(PLATFORM), OS_AIX)
PLATFORM_CCFLAGS += -I$(GTEST_DIR) PLATFORM_CCFLAGS += -I$(GTEST_DIR)

View File

@ -78,7 +78,7 @@ ROCKSDB_PREPROCESSOR_FLAGS = [
# Directories with files for #include # Directories with files for #include
"-I" + REPO_PATH + "include/", "-I" + REPO_PATH + "include/",
"-I" + REPO_PATH, "-I" + REPO_PATH,
"-I" + REPO_PATH + "third-party/gtest-1.8.1/fused-src/", "-I" + REPO_PATH + "third-party/gtest-1.10.0/fused-src/",
] ]
ROCKSDB_ARCH_PREPROCESSOR_FLAGS = { ROCKSDB_ARCH_PREPROCESSOR_FLAGS = {
@ -451,8 +451,8 @@ cpp_library(
cpp_library( cpp_library(
name = "rocksdb_third_party_gtest", name = "rocksdb_third_party_gtest",
srcs = ["third-party/gtest-1.8.1/fused-src/gtest/gtest-all.cc"], srcs = ["third-party/gtest-1.10.0/fused-src/gtest/gtest-all.cc"],
headers = ["third-party/gtest-1.8.1/fused-src/gtest/gtest.h"], headers = ["third-party/gtest-1.10.0/fused-src/gtest/gtest.h"],
arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS, arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS,
compiler_flags = ROCKSDB_COMPILER_FLAGS, compiler_flags = ROCKSDB_COMPILER_FLAGS,
os_deps = ROCKSDB_OS_DEPS, os_deps = ROCKSDB_OS_DEPS,

7
cache/cache_test.cc vendored
View File

@ -758,12 +758,13 @@ TEST_P(CacheTest, GetCharge) {
#ifdef SUPPORT_CLOCK_CACHE #ifdef SUPPORT_CLOCK_CACHE
std::shared_ptr<Cache> (*new_clock_cache_func)( std::shared_ptr<Cache> (*new_clock_cache_func)(
size_t, int, bool, CacheMetadataChargePolicy) = NewClockCache; size_t, int, bool, CacheMetadataChargePolicy) = NewClockCache;
INSTANTIATE_TEST_CASE_P(CacheTestInstance, CacheTest, INSTANTIATE_TEST_SUITE_P(CacheTestInstance, CacheTest,
testing::Values(kLRU, kClock)); testing::Values(kLRU, kClock));
#else #else
INSTANTIATE_TEST_CASE_P(CacheTestInstance, CacheTest, testing::Values(kLRU)); INSTANTIATE_TEST_SUITE_P(CacheTestInstance, CacheTest, testing::Values(kLRU));
#endif // SUPPORT_CLOCK_CACHE #endif // SUPPORT_CLOCK_CACHE
INSTANTIATE_TEST_CASE_P(CacheTestInstance, LRUCacheTest, testing::Values(kLRU)); INSTANTIATE_TEST_SUITE_P(CacheTestInstance, LRUCacheTest,
testing::Values(kLRU));
} // namespace ROCKSDB_NAMESPACE } // namespace ROCKSDB_NAMESPACE

View File

@ -560,9 +560,9 @@ class ColumnFamilyTest
ColumnFamilyTest() : ColumnFamilyTestBase(GetParam()) {} ColumnFamilyTest() : ColumnFamilyTestBase(GetParam()) {}
}; };
INSTANTIATE_TEST_CASE_P(FormatDef, ColumnFamilyTest, INSTANTIATE_TEST_SUITE_P(FormatDef, ColumnFamilyTest,
testing::Values(test::kDefaultFormatVersion)); testing::Values(test::kDefaultFormatVersion));
INSTANTIATE_TEST_CASE_P(FormatLatest, ColumnFamilyTest, INSTANTIATE_TEST_SUITE_P(FormatLatest, ColumnFamilyTest,
testing::Values(test::kLatestFormatVersion)); testing::Values(test::kLatestFormatVersion));
TEST_P(ColumnFamilyTest, DontReuseColumnFamilyID) { TEST_P(ColumnFamilyTest, DontReuseColumnFamilyID) {
@ -749,11 +749,11 @@ TEST_P(FlushEmptyCFTestWithParam, FlushEmptyCFTest2) {
db_options_.env = env_; db_options_.env = env_;
} }
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
FormatDef, FlushEmptyCFTestWithParam, FormatDef, FlushEmptyCFTestWithParam,
testing::Values(std::make_tuple(test::kDefaultFormatVersion, true), testing::Values(std::make_tuple(test::kDefaultFormatVersion, true),
std::make_tuple(test::kDefaultFormatVersion, false))); std::make_tuple(test::kDefaultFormatVersion, false)));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
FormatLatest, FlushEmptyCFTestWithParam, FormatLatest, FlushEmptyCFTestWithParam,
testing::Values(std::make_tuple(test::kLatestFormatVersion, true), testing::Values(std::make_tuple(test::kLatestFormatVersion, true),
std::make_tuple(test::kLatestFormatVersion, false))); std::make_tuple(test::kLatestFormatVersion, false)));

View File

@ -697,7 +697,7 @@ TEST_P(CompactionIteratorTest, RemoveSingleDeletionAtBottomLevel) {
nullptr /*compaction_filter*/, true /*bottommost_level*/); nullptr /*compaction_filter*/, true /*bottommost_level*/);
} }
INSTANTIATE_TEST_CASE_P(CompactionIteratorTestInstance, CompactionIteratorTest, INSTANTIATE_TEST_SUITE_P(CompactionIteratorTestInstance, CompactionIteratorTest,
testing::Values(true, false)); testing::Values(true, false));
// Tests how CompactionIterator work together with SnapshotChecker. // Tests how CompactionIterator work together with SnapshotChecker.

View File

@ -1017,7 +1017,7 @@ TEST_P(CompactionJobStatsTest, UniversalCompactionTest) {
ASSERT_EQ(stats_checker->NumberOfUnverifiedStats(), 0U); ASSERT_EQ(stats_checker->NumberOfUnverifiedStats(), 0U);
} }
INSTANTIATE_TEST_CASE_P(CompactionJobStatsTest, CompactionJobStatsTest, INSTANTIATE_TEST_SUITE_P(CompactionJobStatsTest, CompactionJobStatsTest,
::testing::Values(1, 4)); ::testing::Values(1, 4));
} // namespace ROCKSDB_NAMESPACE } // namespace ROCKSDB_NAMESPACE

View File

@ -314,9 +314,9 @@ class ComparatorDBTest
} }
}; };
INSTANTIATE_TEST_CASE_P(FormatDef, ComparatorDBTest, INSTANTIATE_TEST_SUITE_P(FormatDef, ComparatorDBTest,
testing::Values(test::kDefaultFormatVersion)); testing::Values(test::kDefaultFormatVersion));
INSTANTIATE_TEST_CASE_P(FormatLatest, ComparatorDBTest, INSTANTIATE_TEST_SUITE_P(FormatLatest, ComparatorDBTest,
testing::Values(test::kLatestFormatVersion)); testing::Values(test::kLatestFormatVersion));
TEST_P(ComparatorDBTest, Bytewise) { TEST_P(ComparatorDBTest, Bytewise) {

View File

@ -1251,7 +1251,7 @@ TEST_P(DBMultiGetTestWithParam, MultiGetMultiCFSnapshot) {
} }
} }
INSTANTIATE_TEST_CASE_P(DBMultiGetTestWithParam, DBMultiGetTestWithParam, INSTANTIATE_TEST_SUITE_P(DBMultiGetTestWithParam, DBMultiGetTestWithParam,
testing::Bool()); testing::Bool());
TEST_F(DBBasicTest, MultiGetBatchedSimpleUnsorted) { TEST_F(DBBasicTest, MultiGetBatchedSimpleUnsorted) {
@ -1773,7 +1773,7 @@ TEST_P(MultiGetPrefixExtractorTest, Batched) {
ASSERT_EQ(get_perf_context()->bloom_sst_hit_count, 4); ASSERT_EQ(get_perf_context()->bloom_sst_hit_count, 4);
} }
INSTANTIATE_TEST_CASE_P(MultiGetPrefix, MultiGetPrefixExtractorTest, INSTANTIATE_TEST_SUITE_P(MultiGetPrefix, MultiGetPrefixExtractorTest,
::testing::Bool()); ::testing::Bool());
#ifndef ROCKSDB_LITE #ifndef ROCKSDB_LITE
@ -1865,7 +1865,7 @@ TEST_P(DBMultiGetRowCacheTest, MultiGetBatched) {
} while (ChangeCompactOptions()); } while (ChangeCompactOptions());
} }
INSTANTIATE_TEST_CASE_P(DBMultiGetRowCacheTest, DBMultiGetRowCacheTest, INSTANTIATE_TEST_SUITE_P(DBMultiGetRowCacheTest, DBMultiGetRowCacheTest,
testing::Values(true, false)); testing::Values(true, false));
TEST_F(DBBasicTest, GetAllKeyVersions) { TEST_F(DBBasicTest, GetAllKeyVersions) {
@ -2630,16 +2630,16 @@ TEST_P(DBBasicTestWithParallelIO, MultiGetWithMissingFile) {
SyncPoint::GetInstance()->DisableProcessing(); SyncPoint::GetInstance()->DisableProcessing();
} }
INSTANTIATE_TEST_CASE_P(ParallelIO, DBBasicTestWithParallelIO, INSTANTIATE_TEST_SUITE_P(
ParallelIO, DBBasicTestWithParallelIO,
// Params are as follows - // Params are as follows -
// Param 0 - Compressed cache enabled // Param 0 - Compressed cache enabled
// Param 1 - Uncompressed cache enabled // Param 1 - Uncompressed cache enabled
// Param 2 - Data compression enabled // Param 2 - Data compression enabled
// Param 3 - ReadOptions::fill_cache // Param 3 - ReadOptions::fill_cache
// Param 4 - CompressionOptions::parallel_threads // Param 4 - CompressionOptions::parallel_threads
::testing::Combine(::testing::Bool(), ::testing::Bool(), ::testing::Combine(::testing::Bool(), ::testing::Bool(), ::testing::Bool(),
::testing::Bool(), ::testing::Bool(), ::testing::Bool(), ::testing::Values(1, 4)));
::testing::Values(1, 4)));
// A test class for intercepting random reads and injecting artificial // A test class for intercepting random reads and injecting artificial
// delays. Used for testing the deadline/timeout feature // delays. Used for testing the deadline/timeout feature

View File

@ -504,7 +504,7 @@ TEST_P(DBBloomFilterTestWithParam, BloomFilter) {
} }
#ifndef ROCKSDB_VALGRIND_RUN #ifndef ROCKSDB_VALGRIND_RUN
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
FormatDef, DBBloomFilterTestDefFormatVersion, FormatDef, DBBloomFilterTestDefFormatVersion,
::testing::Values( ::testing::Values(
std::make_tuple(BFP::kDeprecatedBlock, false, std::make_tuple(BFP::kDeprecatedBlock, false,
@ -512,7 +512,7 @@ INSTANTIATE_TEST_CASE_P(
std::make_tuple(BFP::kAuto, true, test::kDefaultFormatVersion), std::make_tuple(BFP::kAuto, true, test::kDefaultFormatVersion),
std::make_tuple(BFP::kAuto, false, test::kDefaultFormatVersion))); std::make_tuple(BFP::kAuto, false, test::kDefaultFormatVersion)));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
FormatDef, DBBloomFilterTestWithParam, FormatDef, DBBloomFilterTestWithParam,
::testing::Values( ::testing::Values(
std::make_tuple(BFP::kDeprecatedBlock, false, std::make_tuple(BFP::kDeprecatedBlock, false,
@ -520,7 +520,7 @@ INSTANTIATE_TEST_CASE_P(
std::make_tuple(BFP::kAuto, true, test::kDefaultFormatVersion), std::make_tuple(BFP::kAuto, true, test::kDefaultFormatVersion),
std::make_tuple(BFP::kAuto, false, test::kDefaultFormatVersion))); std::make_tuple(BFP::kAuto, false, test::kDefaultFormatVersion)));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
FormatLatest, DBBloomFilterTestWithParam, FormatLatest, DBBloomFilterTestWithParam,
::testing::Values( ::testing::Values(
std::make_tuple(BFP::kDeprecatedBlock, false, std::make_tuple(BFP::kDeprecatedBlock, false,
@ -1217,18 +1217,15 @@ TEST_P(DBBloomFilterTestVaryPrefixAndFormatVer, PartitionedMultiGet) {
EXPECT_TRUE(found_spanning >= 2); EXPECT_TRUE(found_spanning >= 2);
} }
INSTANTIATE_TEST_CASE_P(DBBloomFilterTestVaryPrefixAndFormatVer, INSTANTIATE_TEST_SUITE_P(
DBBloomFilterTestVaryPrefixAndFormatVer,
DBBloomFilterTestVaryPrefixAndFormatVer, DBBloomFilterTestVaryPrefixAndFormatVer,
::testing::Values( ::testing::Values(
// (use_prefix, format_version) // (use_prefix, format_version)
std::make_tuple(false, 2), std::make_tuple(false, 2), std::make_tuple(false, 3),
std::make_tuple(false, 3), std::make_tuple(false, 4), std::make_tuple(false, 5),
std::make_tuple(false, 4), std::make_tuple(true, 2), std::make_tuple(true, 3),
std::make_tuple(false, 5), std::make_tuple(true, 4), std::make_tuple(true, 5)));
std::make_tuple(true, 2),
std::make_tuple(true, 3),
std::make_tuple(true, 4),
std::make_tuple(true, 5)));
#ifndef ROCKSDB_LITE #ifndef ROCKSDB_LITE
namespace { namespace {
@ -1398,7 +1395,7 @@ TEST_P(BloomStatsTestWithParam, BloomStatsTestWithIter) {
ASSERT_EQ(expected_hits, get_perf_context()->bloom_sst_hit_count); ASSERT_EQ(expected_hits, get_perf_context()->bloom_sst_hit_count);
} }
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
BloomStatsTestWithParam, BloomStatsTestWithParam, BloomStatsTestWithParam, BloomStatsTestWithParam,
::testing::Values(std::make_tuple(BFP::kDeprecatedBlock, false), ::testing::Values(std::make_tuple(BFP::kDeprecatedBlock, false),
std::make_tuple(BFP::kLegacyBloom, false), std::make_tuple(BFP::kLegacyBloom, false),

View File

@ -46,7 +46,7 @@ class DBTestCompactionFilterWithCompactParam
}; };
#ifndef ROCKSDB_VALGRIND_RUN #ifndef ROCKSDB_VALGRIND_RUN
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
CompactionFilterWithOption, DBTestCompactionFilterWithCompactParam, CompactionFilterWithOption, DBTestCompactionFilterWithCompactParam,
::testing::Values(DBTestBase::OptionConfig::kDefault, ::testing::Values(DBTestBase::OptionConfig::kDefault,
DBTestBase::OptionConfig::kUniversalCompaction, DBTestBase::OptionConfig::kUniversalCompaction,
@ -55,7 +55,7 @@ INSTANTIATE_TEST_CASE_P(
DBTestBase::OptionConfig::kUniversalSubcompactions)); DBTestBase::OptionConfig::kUniversalSubcompactions));
#else #else
// Run fewer cases in valgrind // Run fewer cases in valgrind
INSTANTIATE_TEST_CASE_P(CompactionFilterWithOption, INSTANTIATE_TEST_SUITE_P(CompactionFilterWithOption,
DBTestCompactionFilterWithCompactParam, DBTestCompactionFilterWithCompactParam,
::testing::Values(DBTestBase::OptionConfig::kDefault)); ::testing::Values(DBTestBase::OptionConfig::kDefault));
#endif // ROCKSDB_VALGRIND_RUN #endif // ROCKSDB_VALGRIND_RUN

View File

@ -4690,8 +4690,8 @@ TEST_F(DBCompactionTest, CompactionLimiter) {
ASSERT_OK(dbfull()->TEST_WaitForCompact()); ASSERT_OK(dbfull()->TEST_WaitForCompact());
} }
INSTANTIATE_TEST_CASE_P(DBCompactionTestWithParam, DBCompactionTestWithParam, INSTANTIATE_TEST_SUITE_P(DBCompactionTestWithParam, DBCompactionTestWithParam,
::testing::Values(std::make_tuple(1, true), testing::Values(std::make_tuple(1, true),
std::make_tuple(1, false), std::make_tuple(1, false),
std::make_tuple(4, true), std::make_tuple(4, true),
std::make_tuple(4, false))); std::make_tuple(4, false)));
@ -4728,7 +4728,7 @@ TEST_P(DBCompactionDirectIOTest, DirectIO) {
delete options.env; delete options.env;
} }
INSTANTIATE_TEST_CASE_P(DBCompactionDirectIOTest, DBCompactionDirectIOTest, INSTANTIATE_TEST_SUITE_P(DBCompactionDirectIOTest, DBCompactionDirectIOTest,
testing::Bool()); testing::Bool());
class CompactionPriTest : public DBTestBase, class CompactionPriTest : public DBTestBase,
@ -4774,9 +4774,8 @@ TEST_P(CompactionPriTest, Test) {
} }
} }
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(CompactionPriTest, CompactionPriTest,
CompactionPriTest, CompactionPriTest, testing::Values(CompactionPri::kByCompensatedSize,
::testing::Values(CompactionPri::kByCompensatedSize,
CompactionPri::kOldestLargestSeqFirst, CompactionPri::kOldestLargestSeqFirst,
CompactionPri::kOldestSmallestSeqFirst, CompactionPri::kOldestSmallestSeqFirst,
CompactionPri::kMinOverlappingRatio)); CompactionPri::kMinOverlappingRatio));

View File

@ -770,10 +770,10 @@ TEST_P(DBAtomicFlushTest, RollbackAfterFailToInstallResults) {
SyncPoint::GetInstance()->ClearAllCallBacks(); SyncPoint::GetInstance()->ClearAllCallBacks();
} }
INSTANTIATE_TEST_CASE_P(DBFlushDirectIOTest, DBFlushDirectIOTest, INSTANTIATE_TEST_SUITE_P(DBFlushDirectIOTest, DBFlushDirectIOTest,
testing::Bool()); testing::Bool());
INSTANTIATE_TEST_CASE_P(DBAtomicFlushTest, DBAtomicFlushTest, testing::Bool()); INSTANTIATE_TEST_SUITE_P(DBAtomicFlushTest, DBAtomicFlushTest, testing::Bool());
} // namespace ROCKSDB_NAMESPACE } // namespace ROCKSDB_NAMESPACE

View File

@ -2881,7 +2881,7 @@ TEST_P(DBIteratorTest, IterateWithLowerBoundAcrossFileBoundary) {
ASSERT_OK(iter->status()); ASSERT_OK(iter->status());
} }
INSTANTIATE_TEST_CASE_P(DBIteratorTestInstance, DBIteratorTest, INSTANTIATE_TEST_SUITE_P(DBIteratorTestInstance, DBIteratorTest,
testing::Values(true, false)); testing::Values(true, false));
// Tests how DBIter work with ReadCallback // Tests how DBIter work with ReadCallback

View File

@ -210,7 +210,7 @@ class MergeOperatorPinningTest : public DBMergeOperatorTest,
bool disable_block_cache_; bool disable_block_cache_;
}; };
INSTANTIATE_TEST_CASE_P(MergeOperatorPinningTest, MergeOperatorPinningTest, INSTANTIATE_TEST_SUITE_P(MergeOperatorPinningTest, MergeOperatorPinningTest,
::testing::Bool()); ::testing::Bool());
#ifndef ROCKSDB_LITE #ifndef ROCKSDB_LITE
@ -588,7 +588,7 @@ class PerConfigMergeOperatorPinningTest
bool disable_block_cache_; bool disable_block_cache_;
}; };
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
MergeOperatorPinningTest, PerConfigMergeOperatorPinningTest, MergeOperatorPinningTest, PerConfigMergeOperatorPinningTest,
::testing::Combine(::testing::Bool(), ::testing::Combine(::testing::Bool(),
::testing::Range(static_cast<int>(DBTestBase::kDefault), ::testing::Range(static_cast<int>(DBTestBase::kDefault),

View File

@ -582,7 +582,7 @@ TEST_P(DBWALTestWithParam, WALTrashCleanupOnOpen) {
Close(); Close();
} }
INSTANTIATE_TEST_CASE_P(DBWALTestWithParam, DBWALTestWithParam, INSTANTIATE_TEST_SUITE_P(DBWALTestWithParam, DBWALTestWithParam,
::testing::Values(std::make_tuple("", true), ::testing::Values(std::make_tuple("", true),
std::make_tuple("_wal_dir", false))); std::make_tuple("_wal_dir", false)));

View File

@ -345,13 +345,9 @@ TEST_P(DBTablePropertiesTest, DeletionTriggeredCompactionMarking) {
ASSERT_EQ(1, NumTableFilesAtLevel(0)); ASSERT_EQ(1, NumTableFilesAtLevel(0));
} }
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(DBTablePropertiesTest, DBTablePropertiesTest,
DBTablePropertiesTest, ::testing::Values("kCompactionStyleLevel",
DBTablePropertiesTest, "kCompactionStyleUniversal"));
::testing::Values(
"kCompactionStyleLevel",
"kCompactionStyleUniversal"
));
} // namespace ROCKSDB_NAMESPACE } // namespace ROCKSDB_NAMESPACE

View File

@ -2584,7 +2584,7 @@ TEST_P(MultiThreadedDBTest, MultiThreaded) {
} }
} }
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
MultiThreaded, MultiThreadedDBTest, MultiThreaded, MultiThreadedDBTest,
::testing::Combine( ::testing::Combine(
::testing::ValuesIn(MultiThreadedDBTest::GenerateOptionConfigs()), ::testing::ValuesIn(MultiThreadedDBTest::GenerateOptionConfigs()),
@ -3133,7 +3133,7 @@ class DBTestRandomized : public DBTest,
} }
}; };
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
DBTestRandomized, DBTestRandomized, DBTestRandomized, DBTestRandomized,
::testing::ValuesIn(DBTestRandomized::GenerateOptionConfigs())); ::testing::ValuesIn(DBTestRandomized::GenerateOptionConfigs()));
@ -6433,7 +6433,7 @@ TEST_F(DBTest, UnsupportedManualSync) {
ASSERT_TRUE(s.IsNotSupported()); ASSERT_TRUE(s.IsNotSupported());
} }
INSTANTIATE_TEST_CASE_P(DBTestWithParam, DBTestWithParam, INSTANTIATE_TEST_SUITE_P(DBTestWithParam, DBTestWithParam,
::testing::Combine(::testing::Values(1, 4), ::testing::Combine(::testing::Values(1, 4),
::testing::Bool())); ::testing::Bool()));

View File

@ -84,7 +84,7 @@ TEST_P(PrefixFullBloomWithReverseComparator,
ASSERT_TRUE(!iter->Valid()); ASSERT_TRUE(!iter->Valid());
} }
INSTANTIATE_TEST_CASE_P(PrefixFullBloomWithReverseComparator, INSTANTIATE_TEST_SUITE_P(PrefixFullBloomWithReverseComparator,
PrefixFullBloomWithReverseComparator, testing::Bool()); PrefixFullBloomWithReverseComparator, testing::Bool());
TEST_F(DBTest2, IteratorPropertyVersionNumber) { TEST_F(DBTest2, IteratorPropertyVersionNumber) {
@ -349,7 +349,7 @@ TEST_P(DBTestSharedWriteBufferAcrossCFs, SharedWriteBufferAcrossCFs) {
ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing();
} }
INSTANTIATE_TEST_CASE_P(DBTestSharedWriteBufferAcrossCFs, INSTANTIATE_TEST_SUITE_P(DBTestSharedWriteBufferAcrossCFs,
DBTestSharedWriteBufferAcrossCFs, DBTestSharedWriteBufferAcrossCFs,
::testing::Values(std::make_tuple(true, false), ::testing::Values(std::make_tuple(true, false),
std::make_tuple(false, false), std::make_tuple(false, false),
@ -1862,7 +1862,7 @@ TEST_P(PinL0IndexAndFilterBlocksTest, DisablePrefetchingNonL0IndexAndFilter) {
} }
} }
INSTANTIATE_TEST_CASE_P(PinL0IndexAndFilterBlocksTest, INSTANTIATE_TEST_SUITE_P(PinL0IndexAndFilterBlocksTest,
PinL0IndexAndFilterBlocksTest, PinL0IndexAndFilterBlocksTest,
::testing::Values(std::make_tuple(true, false), ::testing::Values(std::make_tuple(true, false),
std::make_tuple(false, false), std::make_tuple(false, false),

View File

@ -748,7 +748,7 @@ TEST_P(DBTestUniversalCompactionMultiLevels, UniversalCompactionTrivialMove) {
ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing();
} }
INSTANTIATE_TEST_CASE_P(MultiLevels, DBTestUniversalCompactionMultiLevels, INSTANTIATE_TEST_SUITE_P(MultiLevels, DBTestUniversalCompactionMultiLevels,
::testing::Combine(::testing::Values(3, 20), ::testing::Combine(::testing::Values(3, 20),
::testing::Bool())); ::testing::Bool()));
@ -937,7 +937,7 @@ TEST_P(DBTestUniversalCompactionParallel, PickByFileNumberBug) {
EXPECT_GE(total_picked_compactions, 2); EXPECT_GE(total_picked_compactions, 2);
} }
INSTANTIATE_TEST_CASE_P(Parallel, DBTestUniversalCompactionParallel, INSTANTIATE_TEST_SUITE_P(Parallel, DBTestUniversalCompactionParallel,
::testing::Combine(::testing::Values(1, 10), ::testing::Combine(::testing::Values(1, 10),
::testing::Values(false))); ::testing::Values(false)));
#endif // ROCKSDB_VALGRIND_RUN #endif // ROCKSDB_VALGRIND_RUN
@ -1837,7 +1837,7 @@ TEST_P(DBTestUniversalCompaction, FinalSortedRunCompactFilesConflict) {
compact_files_thread.join(); compact_files_thread.join();
} }
INSTANTIATE_TEST_CASE_P(NumLevels, DBTestUniversalCompaction, INSTANTIATE_TEST_SUITE_P(NumLevels, DBTestUniversalCompaction,
::testing::Combine(::testing::Values(1, 3, 5), ::testing::Combine(::testing::Values(1, 3, 5),
::testing::Bool())); ::testing::Bool()));
@ -1907,7 +1907,7 @@ TEST_P(DBTestUniversalManualCompactionOutputPathId,
.IsInvalidArgument()); .IsInvalidArgument());
} }
INSTANTIATE_TEST_CASE_P(OutputPathId, INSTANTIATE_TEST_SUITE_P(OutputPathId,
DBTestUniversalManualCompactionOutputPathId, DBTestUniversalManualCompactionOutputPathId,
::testing::Combine(::testing::Values(1, 8), ::testing::Combine(::testing::Values(1, 8),
::testing::Bool())); ::testing::Bool()));

View File

@ -982,7 +982,7 @@ TEST_F(DBBasicTestWithTimestamp, MultiGetNoReturnTs) {
#endif // !ROCKSDB_LITE #endif // !ROCKSDB_LITE
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
Timestamp, DBBasicTestWithTimestampCompressionSettings, Timestamp, DBBasicTestWithTimestampCompressionSettings,
::testing::Combine( ::testing::Combine(
::testing::Values(std::shared_ptr<const FilterPolicy>(nullptr), ::testing::Values(std::shared_ptr<const FilterPolicy>(nullptr),
@ -1099,7 +1099,7 @@ TEST_P(DBBasicTestWithTimestampPrefixSeek, ForwardIterateWithPrefix) {
// TODO(yanqin): consider handling non-fixed-length prefix extractors, e.g. // TODO(yanqin): consider handling non-fixed-length prefix extractors, e.g.
// NoopTransform. // NoopTransform.
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
Timestamp, DBBasicTestWithTimestampPrefixSeek, Timestamp, DBBasicTestWithTimestampPrefixSeek,
::testing::Combine( ::testing::Combine(
::testing::Values( ::testing::Values(
@ -1185,7 +1185,7 @@ TEST_P(DBBasicTestWithTsIterTombstones, ForwardIterDelete) {
Close(); Close();
} }
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
Timestamp, DBBasicTestWithTsIterTombstones, Timestamp, DBBasicTestWithTsIterTombstones,
::testing::Combine( ::testing::Combine(
::testing::Values( ::testing::Values(

View File

@ -315,7 +315,7 @@ TEST_P(DBWriteTest, ConcurrentlyDisabledWAL) {
ASSERT_LE(bytes_num, 1024 * 100); ASSERT_LE(bytes_num, 1024 * 100);
} }
INSTANTIATE_TEST_CASE_P(DBWriteTestInstance, DBWriteTest, INSTANTIATE_TEST_SUITE_P(DBWriteTestInstance, DBWriteTest,
testing::Values(DBTestBase::kDefault, testing::Values(DBTestBase::kDefault,
DBTestBase::kConcurrentWALWrites, DBTestBase::kConcurrentWALWrites,
DBTestBase::kPipelinedWrite)); DBTestBase::kPipelinedWrite));

View File

@ -1256,7 +1256,7 @@ TEST_F(ExternalSSTFileBasicTest, OverlappingFiles) {
ASSERT_EQ(2, NumTableFilesAtLevel(0)); ASSERT_EQ(2, NumTableFilesAtLevel(0));
} }
INSTANTIATE_TEST_CASE_P(ExternalSSTFileBasicTest, ExternalSSTFileBasicTest, INSTANTIATE_TEST_SUITE_P(ExternalSSTFileBasicTest, ExternalSSTFileBasicTest,
testing::Values(std::make_tuple(true, true), testing::Values(std::make_tuple(true, true),
std::make_tuple(true, false), std::make_tuple(true, false),
std::make_tuple(false, true), std::make_tuple(false, true),

View File

@ -2897,13 +2897,13 @@ TEST_P(ExternalSSTFileTest,
delete iter; delete iter;
} }
INSTANTIATE_TEST_CASE_P(ExternalSSTFileTest, ExternalSSTFileTest, INSTANTIATE_TEST_SUITE_P(ExternalSSTFileTest, ExternalSSTFileTest,
testing::Values(std::make_tuple(false, false), testing::Values(std::make_tuple(false, false),
std::make_tuple(false, true), std::make_tuple(false, true),
std::make_tuple(true, false), std::make_tuple(true, false),
std::make_tuple(true, true))); std::make_tuple(true, true)));
INSTANTIATE_TEST_CASE_P(ExternSSTFileLinkFailFallbackTest, INSTANTIATE_TEST_SUITE_P(ExternSSTFileLinkFailFallbackTest,
ExternSSTFileLinkFailFallbackTest, ExternSSTFileLinkFailFallbackTest,
testing::Values(std::make_tuple(true, false), testing::Values(std::make_tuple(true, false),
std::make_tuple(true, true), std::make_tuple(true, true),

View File

@ -535,12 +535,12 @@ TEST_P(FaultInjectionTest, WriteBatchWalTerminationTest) {
ASSERT_EQ(db_->Get(ro, "boys", &val), Status::NotFound()); ASSERT_EQ(db_->Get(ro, "boys", &val), Status::NotFound());
} }
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
FaultTest, FaultInjectionTest, FaultTest, FaultInjectionTest,
::testing::Values(std::make_tuple(false, kDefault, kEnd), ::testing::Values(std::make_tuple(false, kDefault, kEnd),
std::make_tuple(true, kDefault, kEnd))); std::make_tuple(true, kDefault, kEnd)));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
FaultTest, FaultInjectionTestSplitted, FaultTest, FaultInjectionTestSplitted,
::testing::Values(std::make_tuple(false, kDefault, kSyncWal), ::testing::Values(std::make_tuple(false, kDefault, kSyncWal),
std::make_tuple(true, kDefault, kSyncWal), std::make_tuple(true, kDefault, kSyncWal),

View File

@ -699,7 +699,7 @@ TEST_P(LogTest, Recycle) {
ASSERT_EQ("EOF", Read()); ASSERT_EQ("EOF", Read());
} }
INSTANTIATE_TEST_CASE_P(bool, LogTest, INSTANTIATE_TEST_SUITE_P(bool, LogTest,
::testing::Values(std::make_tuple(0, false), ::testing::Values(std::make_tuple(0, false),
std::make_tuple(0, true), std::make_tuple(0, true),
std::make_tuple(1, false), std::make_tuple(1, false),
@ -917,7 +917,7 @@ TEST_P(RetriableLogTest, NonBlockingReadFullRecord) {
ASSERT_EQ("foo-bar", record); ASSERT_EQ("foo-bar", record);
} }
INSTANTIATE_TEST_CASE_P(bool, RetriableLogTest, ::testing::Values(0, 2)); INSTANTIATE_TEST_SUITE_P(bool, RetriableLogTest, ::testing::Values(0, 2));
} // namespace log } // namespace log
} // namespace ROCKSDB_NAMESPACE } // namespace ROCKSDB_NAMESPACE

View File

@ -1355,7 +1355,7 @@ TEST_P(PlainTableDBTest, AdaptiveTable) {
ASSERT_NE("v5", Get("3000000000000bar")); ASSERT_NE("v5", Get("3000000000000bar"));
} }
INSTANTIATE_TEST_CASE_P(PlainTableDBTest, PlainTableDBTest, ::testing::Bool()); INSTANTIATE_TEST_SUITE_P(PlainTableDBTest, PlainTableDBTest, ::testing::Bool());
} // namespace ROCKSDB_NAMESPACE } // namespace ROCKSDB_NAMESPACE

View File

@ -501,11 +501,11 @@ TEST_P(TablePropertiesTest, InternalKeyPropertiesCollector) {
#endif // !ROCKSDB_LITE #endif // !ROCKSDB_LITE
} }
INSTANTIATE_TEST_CASE_P(InternalKeyPropertiesCollector, TablePropertiesTest, INSTANTIATE_TEST_SUITE_P(InternalKeyPropertiesCollector, TablePropertiesTest,
::testing::Bool()); ::testing::Bool());
INSTANTIATE_TEST_CASE_P(CustomizedTablePropertiesCollector, TablePropertiesTest, INSTANTIATE_TEST_SUITE_P(CustomizedTablePropertiesCollector,
::testing::Bool()); TablePropertiesTest, ::testing::Bool());
} // namespace ROCKSDB_NAMESPACE } // namespace ROCKSDB_NAMESPACE

View File

@ -1636,7 +1636,7 @@ TEST_P(VersionSetTestDropOneCF, HandleDroppedColumnFamilyInAtomicGroup) {
} }
} }
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
AtomicGroup, VersionSetTestDropOneCF, AtomicGroup, VersionSetTestDropOneCF,
testing::Values(VersionSetTestBase::kColumnFamilyName1, testing::Values(VersionSetTestBase::kColumnFamilyName1,
VersionSetTestBase::kColumnFamilyName2, VersionSetTestBase::kColumnFamilyName2,
@ -1992,7 +1992,7 @@ TEST_P(VersionSetTestEmptyDb, OpenCompleteManifest) {
} }
} }
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
BestEffortRecovery, VersionSetTestEmptyDb, BestEffortRecovery, VersionSetTestEmptyDb,
testing::Combine( testing::Combine(
/*write_dbid_to_manifest=*/testing::Bool(), /*write_dbid_to_manifest=*/testing::Bool(),

12
env/env_basic_test.cc vendored
View File

@ -81,17 +81,17 @@ class EnvBasicTestWithParam : public testing::Test,
class EnvMoreTestWithParam : public EnvBasicTestWithParam {}; class EnvMoreTestWithParam : public EnvBasicTestWithParam {};
static std::unique_ptr<Env> def_env(new NormalizingEnvWrapper(Env::Default())); static std::unique_ptr<Env> def_env(new NormalizingEnvWrapper(Env::Default()));
INSTANTIATE_TEST_CASE_P(EnvDefault, EnvBasicTestWithParam, INSTANTIATE_TEST_SUITE_P(EnvDefault, EnvBasicTestWithParam,
::testing::Values(def_env.get())); ::testing::Values(def_env.get()));
INSTANTIATE_TEST_CASE_P(EnvDefault, EnvMoreTestWithParam, INSTANTIATE_TEST_SUITE_P(EnvDefault, EnvMoreTestWithParam,
::testing::Values(def_env.get())); ::testing::Values(def_env.get()));
static std::unique_ptr<Env> mock_env(new MockEnv(Env::Default())); static std::unique_ptr<Env> mock_env(new MockEnv(Env::Default()));
INSTANTIATE_TEST_CASE_P(MockEnv, EnvBasicTestWithParam, INSTANTIATE_TEST_SUITE_P(MockEnv, EnvBasicTestWithParam,
::testing::Values(mock_env.get())); ::testing::Values(mock_env.get()));
#ifndef ROCKSDB_LITE #ifndef ROCKSDB_LITE
static std::unique_ptr<Env> mem_env(NewMemEnv(Env::Default())); static std::unique_ptr<Env> mem_env(NewMemEnv(Env::Default()));
INSTANTIATE_TEST_CASE_P(MemEnv, EnvBasicTestWithParam, INSTANTIATE_TEST_SUITE_P(MemEnv, EnvBasicTestWithParam,
::testing::Values(mem_env.get())); ::testing::Values(mem_env.get()));
namespace { namespace {
@ -121,10 +121,10 @@ std::vector<Env*> GetCustomEnvs() {
} // anonymous namespace } // anonymous namespace
INSTANTIATE_TEST_CASE_P(CustomEnv, EnvBasicTestWithParam, INSTANTIATE_TEST_SUITE_P(CustomEnv, EnvBasicTestWithParam,
::testing::ValuesIn(GetCustomEnvs())); ::testing::ValuesIn(GetCustomEnvs()));
INSTANTIATE_TEST_CASE_P(CustomEnv, EnvMoreTestWithParam, INSTANTIATE_TEST_SUITE_P(CustomEnv, EnvMoreTestWithParam,
::testing::ValuesIn(GetCustomEnvs())); ::testing::ValuesIn(GetCustomEnvs()));
#endif // ROCKSDB_LITE #endif // ROCKSDB_LITE

14
env/env_test.cc vendored
View File

@ -1968,11 +1968,11 @@ TEST_F(EnvTest, Close) {
delete env; delete env;
} }
INSTANTIATE_TEST_CASE_P(DefaultEnvWithoutDirectIO, EnvPosixTestWithParam, INSTANTIATE_TEST_SUITE_P(DefaultEnvWithoutDirectIO, EnvPosixTestWithParam,
::testing::Values(std::pair<Env*, bool>(Env::Default(), ::testing::Values(std::pair<Env*, bool>(Env::Default(),
false))); false)));
#if !defined(ROCKSDB_LITE) #if !defined(ROCKSDB_LITE)
INSTANTIATE_TEST_CASE_P(DefaultEnvWithDirectIO, EnvPosixTestWithParam, INSTANTIATE_TEST_SUITE_P(DefaultEnvWithDirectIO, EnvPosixTestWithParam,
::testing::Values(std::pair<Env*, bool>(Env::Default(), ::testing::Values(std::pair<Env*, bool>(Env::Default(),
true))); true)));
#endif // !defined(ROCKSDB_LITE) #endif // !defined(ROCKSDB_LITE)
@ -1980,10 +1980,10 @@ INSTANTIATE_TEST_CASE_P(DefaultEnvWithDirectIO, EnvPosixTestWithParam,
#if !defined(ROCKSDB_LITE) && !defined(OS_WIN) #if !defined(ROCKSDB_LITE) && !defined(OS_WIN)
static std::unique_ptr<Env> chroot_env( static std::unique_ptr<Env> chroot_env(
NewChrootEnv(Env::Default(), test::TmpDir(Env::Default()))); NewChrootEnv(Env::Default(), test::TmpDir(Env::Default())));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
ChrootEnvWithoutDirectIO, EnvPosixTestWithParam, ChrootEnvWithoutDirectIO, EnvPosixTestWithParam,
::testing::Values(std::pair<Env*, bool>(chroot_env.get(), false))); ::testing::Values(std::pair<Env*, bool>(chroot_env.get(), false)));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
ChrootEnvWithDirectIO, EnvPosixTestWithParam, ChrootEnvWithDirectIO, EnvPosixTestWithParam,
::testing::Values(std::pair<Env*, bool>(chroot_env.get(), true))); ::testing::Values(std::pair<Env*, bool>(chroot_env.get(), true)));
#endif // !defined(ROCKSDB_LITE) && !defined(OS_WIN) #endif // !defined(ROCKSDB_LITE) && !defined(OS_WIN)
@ -2073,9 +2073,9 @@ TEST_P(EnvFSTestWithParam, OptionsTest) {
// 1. True means Options::env is non-null, false means null // 1. True means Options::env is non-null, false means null
// 2. True means use Env::Default, false means custom // 2. True means use Env::Default, false means custom
// 3. True means use FileSystem::Default, false means custom // 3. True means use FileSystem::Default, false means custom
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(EnvFSTest, EnvFSTestWithParam,
EnvFSTest, EnvFSTestWithParam, ::testing::Combine(::testing::Bool(),
::testing::Combine(::testing::Bool(), ::testing::Bool(), ::testing::Bool(),
::testing::Bool())); ::testing::Bool()));
// This test ensures that default Env and those allocated by // This test ensures that default Env and those allocated by

2
src.mk
View File

@ -428,7 +428,7 @@ MAIN_SOURCES = \
table/table_reader_bench.cc \ table/table_reader_bench.cc \
table/table_test.cc \ table/table_test.cc \
table/block_fetcher_test.cc \ table/block_fetcher_test.cc \
third-party/gtest-1.8.1/fused-src/gtest/gtest-all.cc \ third-party/gtest-1.10.0/fused-src/gtest/gtest-all.cc \
tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc \ tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc \
tools/block_cache_analyzer/block_cache_trace_analyzer_tool.cc \ tools/block_cache_analyzer/block_cache_trace_analyzer_tool.cc \
tools/db_bench.cc \ tools/db_bench.cc \

View File

@ -223,12 +223,12 @@ TEST_P(BlockBasedTableReaderTest, MultiGet) {
// Param 2: whether to use direct reads // Param 2: whether to use direct reads
#ifdef ROCKSDB_LITE #ifdef ROCKSDB_LITE
// Skip direct I/O tests in lite mode since direct I/O is unsupported. // Skip direct I/O tests in lite mode since direct I/O is unsupported.
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
MultiGet, BlockBasedTableReaderTest, MultiGet, BlockBasedTableReaderTest,
::testing::Combine(::testing::ValuesIn(GetSupportedCompressions()), ::testing::Combine(::testing::ValuesIn(GetSupportedCompressions()),
::testing::Values(false))); ::testing::Values(false)));
#else // ROCKSDB_LITE #else // ROCKSDB_LITE
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
MultiGet, BlockBasedTableReaderTest, MultiGet, BlockBasedTableReaderTest,
::testing::Combine(::testing::ValuesIn(GetSupportedCompressions()), ::testing::Combine(::testing::ValuesIn(GetSupportedCompressions()),
::testing::Bool())); ::testing::Bool()));

View File

@ -617,7 +617,7 @@ TEST_P(IndexBlockTest, IndexValueEncodingTest) {
delete iter; delete iter;
} }
INSTANTIATE_TEST_CASE_P(P, IndexBlockTest, INSTANTIATE_TEST_SUITE_P(P, IndexBlockTest,
::testing::Values(std::make_tuple(false, false), ::testing::Values(std::make_tuple(false, false),
std::make_tuple(false, true), std::make_tuple(false, true),
std::make_tuple(true, false), std::make_tuple(true, false),

View File

@ -290,9 +290,9 @@ class PartitionedFilterBlockTest
} }
}; };
INSTANTIATE_TEST_CASE_P(FormatDef, PartitionedFilterBlockTest, INSTANTIATE_TEST_SUITE_P(FormatDef, PartitionedFilterBlockTest,
testing::Values(test::kDefaultFormatVersion)); testing::Values(test::kDefaultFormatVersion));
INSTANTIATE_TEST_CASE_P(FormatLatest, PartitionedFilterBlockTest, INSTANTIATE_TEST_SUITE_P(FormatLatest, PartitionedFilterBlockTest,
testing::Values(test::kLatestFormatVersion)); testing::Values(test::kLatestFormatVersion));
TEST_P(PartitionedFilterBlockTest, EmptyBuilder) { TEST_P(PartitionedFilterBlockTest, EmptyBuilder) {

View File

@ -1298,9 +1298,9 @@ class FileChecksumTestHelper {
uint64_t FileChecksumTestHelper::checksum_uniq_id_ = 1; uint64_t FileChecksumTestHelper::checksum_uniq_id_ = 1;
INSTANTIATE_TEST_CASE_P(FormatDef, BlockBasedTableTest, INSTANTIATE_TEST_SUITE_P(FormatDef, BlockBasedTableTest,
testing::Values(test::kDefaultFormatVersion)); testing::Values(test::kDefaultFormatVersion));
INSTANTIATE_TEST_CASE_P(FormatLatest, BlockBasedTableTest, INSTANTIATE_TEST_SUITE_P(FormatLatest, BlockBasedTableTest,
testing::Values(test::kLatestFormatVersion)); testing::Values(test::kLatestFormatVersion));
// This test serves as the living tutorial for the prefix scan of user collected // This test serves as the living tutorial for the prefix scan of user collected
@ -3924,7 +3924,7 @@ class IndexBlockRestartIntervalTest
} }
}; };
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
IndexBlockRestartIntervalTest, IndexBlockRestartIntervalTest, IndexBlockRestartIntervalTest, IndexBlockRestartIntervalTest,
::testing::ValuesIn(IndexBlockRestartIntervalTest::GetRestartValues())); ::testing::ValuesIn(IndexBlockRestartIntervalTest::GetRestartValues()));

View File

@ -27,11 +27,21 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdio.h> #include <cstdio>
#include "gtest/gtest.h" #include "gtest/gtest.h"
#ifdef ARDUINO
void setup() {
testing::InitGoogleTest();
}
void loop() { RUN_ALL_TESTS(); }
#else
GTEST_API_ int main(int argc, char **argv) { GTEST_API_ int main(int argc, char **argv) {
printf("Running main() from %s\n", __FILE__); printf("Running main() from %s\n", __FILE__);
testing::InitGoogleTest(&argc, argv); testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();
} }
#endif

View File

@ -899,7 +899,7 @@ TEST_P(FullBloomTest, CorruptFilters) {
} }
} }
INSTANTIATE_TEST_CASE_P(Full, FullBloomTest, INSTANTIATE_TEST_SUITE_P(Full, FullBloomTest,
testing::Values(BloomFilterPolicy::kLegacyBloom, testing::Values(BloomFilterPolicy::kLegacyBloom,
BloomFilterPolicy::kFastLocalBloom)); BloomFilterPolicy::kFastLocalBloom));

View File

@ -316,16 +316,16 @@ TEST_P(ReadaheadRandomAccessFileTest, ReadExceedsReadaheadSize) {
} }
} }
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
EmptySourceStr, ReadaheadRandomAccessFileTest, EmptySourceStr, ReadaheadRandomAccessFileTest,
::testing::ValuesIn(ReadaheadRandomAccessFileTest::GetReadaheadSizeList())); ::testing::ValuesIn(ReadaheadRandomAccessFileTest::GetReadaheadSizeList()));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
SourceStrLenLessThanReadaheadSize, ReadaheadRandomAccessFileTest, SourceStrLenLessThanReadaheadSize, ReadaheadRandomAccessFileTest,
::testing::ValuesIn(ReadaheadRandomAccessFileTest::GetReadaheadSizeList())); ::testing::ValuesIn(ReadaheadRandomAccessFileTest::GetReadaheadSizeList()));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
SourceStrLenGreaterThanReadaheadSize, ReadaheadRandomAccessFileTest, SourceStrLenGreaterThanReadaheadSize, ReadaheadRandomAccessFileTest,
::testing::ValuesIn(ReadaheadRandomAccessFileTest::GetReadaheadSizeList())); ::testing::ValuesIn(ReadaheadRandomAccessFileTest::GetReadaheadSizeList()));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
ReadExceedsReadaheadSize, ReadaheadRandomAccessFileTest, ReadExceedsReadaheadSize, ReadaheadRandomAccessFileTest,
::testing::ValuesIn(ReadaheadRandomAccessFileTest::GetReadaheadSizeList())); ::testing::ValuesIn(ReadaheadRandomAccessFileTest::GetReadaheadSizeList()));
@ -424,16 +424,16 @@ TEST_P(ReadaheadSequentialFileTest, ReadExceedsReadaheadSize) {
} }
} }
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
EmptySourceStr, ReadaheadSequentialFileTest, EmptySourceStr, ReadaheadSequentialFileTest,
::testing::ValuesIn(ReadaheadSequentialFileTest::GetReadaheadSizeList())); ::testing::ValuesIn(ReadaheadSequentialFileTest::GetReadaheadSizeList()));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
SourceStrLenLessThanReadaheadSize, ReadaheadSequentialFileTest, SourceStrLenLessThanReadaheadSize, ReadaheadSequentialFileTest,
::testing::ValuesIn(ReadaheadSequentialFileTest::GetReadaheadSizeList())); ::testing::ValuesIn(ReadaheadSequentialFileTest::GetReadaheadSizeList()));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
SourceStrLenGreaterThanReadaheadSize, ReadaheadSequentialFileTest, SourceStrLenGreaterThanReadaheadSize, ReadaheadSequentialFileTest,
::testing::ValuesIn(ReadaheadSequentialFileTest::GetReadaheadSizeList())); ::testing::ValuesIn(ReadaheadSequentialFileTest::GetReadaheadSizeList()));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
ReadExceedsReadaheadSize, ReadaheadSequentialFileTest, ReadExceedsReadaheadSize, ReadaheadSequentialFileTest,
::testing::ValuesIn(ReadaheadSequentialFileTest::GetReadaheadSizeList())); ::testing::ValuesIn(ReadaheadSequentialFileTest::GetReadaheadSizeList()));
} // namespace ROCKSDB_NAMESPACE } // namespace ROCKSDB_NAMESPACE

View File

@ -103,30 +103,23 @@ TEST_P(HeapTest, Test) {
} }
// Basic test, MAX_VALUE = 3*MAX_HEAP_SIZE (occasional duplicates) // Basic test, MAX_VALUE = 3*MAX_HEAP_SIZE (occasional duplicates)
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(Basic, HeapTest,
Basic, HeapTest, ::testing::Values(Params(1000, 3000,
::testing::Values(Params(1000, 3000, 0x1b575cf05b708945)) 0x1b575cf05b708945)));
);
// Mid-size heap with small values (many duplicates) // Mid-size heap with small values (many duplicates)
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(SmallValues, HeapTest,
SmallValues, HeapTest, ::testing::Values(Params(100, 10,
::testing::Values(Params(100, 10, 0x5ae213f7bd5dccd0)) 0x5ae213f7bd5dccd0)));
);
// Small heap, large value range (no duplicates) // Small heap, large value range (no duplicates)
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(SmallHeap, HeapTest,
SmallHeap, HeapTest, ::testing::Values(Params(10, ULLONG_MAX,
::testing::Values(Params(10, ULLONG_MAX, 0x3e1fa8f4d01707cf)) 0x3e1fa8f4d01707cf)));
);
// Two-element heap // Two-element heap
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(TwoElementHeap, HeapTest,
TwoElementHeap, HeapTest, ::testing::Values(Params(2, 5, 0x4b5e13ea988c6abc)));
::testing::Values(Params(2, 5, 0x4b5e13ea988c6abc))
);
// One-element heap // One-element heap
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(OneElementHeap, HeapTest,
OneElementHeap, HeapTest, ::testing::Values(Params(1, 3, 0x176a1019ab0b612e)));
::testing::Values(Params(1, 3, 0x176a1019ab0b612e))
);
} // namespace ROCKSDB_NAMESPACE } // namespace ROCKSDB_NAMESPACE

View File

@ -840,7 +840,7 @@ TEST_P(BackupableDBTestWithParam, OnlineIntegrationTest) {
CloseBackupEngine(); CloseBackupEngine();
} }
INSTANTIATE_TEST_CASE_P(BackupableDBTestWithParam, BackupableDBTestWithParam, INSTANTIATE_TEST_SUITE_P(BackupableDBTestWithParam, BackupableDBTestWithParam,
::testing::Bool()); ::testing::Bool());
// this will make sure that backup does not copy the same file twice // this will make sure that backup does not copy the same file twice

View File

@ -329,7 +329,7 @@ TEST_P(DBOptionChangeMigrationTests, Migrate4) {
} }
} }
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
DBOptionChangeMigrationTests, DBOptionChangeMigrationTests, DBOptionChangeMigrationTests, DBOptionChangeMigrationTests,
::testing::Values(std::make_tuple(3, 0, false, 4, 0, false), ::testing::Values(std::make_tuple(3, 0, false, 4, 0, false),
std::make_tuple(3, 0, true, 4, 0, true), std::make_tuple(3, 0, true, 4, 0, true),

View File

@ -1510,7 +1510,7 @@ TEST_P(OptimisticTransactionTest, SequenceNumberAfterRecoverTest) {
delete transaction; delete transaction;
} }
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
InstanceOccGroup, OptimisticTransactionTest, InstanceOccGroup, OptimisticTransactionTest,
testing::Values(OccValidationPolicy::kValidateSerial, testing::Values(OccValidationPolicy::kValidateSerial,
OccValidationPolicy::kValidateParallel)); OccValidationPolicy::kValidateParallel));

View File

@ -36,7 +36,7 @@ using std::string;
namespace ROCKSDB_NAMESPACE { namespace ROCKSDB_NAMESPACE {
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
DBAsBaseDB, TransactionTest, DBAsBaseDB, TransactionTest,
::testing::Values( ::testing::Values(
std::make_tuple(false, false, WRITE_COMMITTED, kOrderedWrite), std::make_tuple(false, false, WRITE_COMMITTED, kOrderedWrite),
@ -46,7 +46,7 @@ INSTANTIATE_TEST_CASE_P(
std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite), std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite),
std::make_tuple(false, false, WRITE_UNPREPARED, kOrderedWrite), std::make_tuple(false, false, WRITE_UNPREPARED, kOrderedWrite),
std::make_tuple(false, true, WRITE_UNPREPARED, kOrderedWrite))); std::make_tuple(false, true, WRITE_UNPREPARED, kOrderedWrite)));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
DBAsBaseDB, TransactionStressTest, DBAsBaseDB, TransactionStressTest,
::testing::Values( ::testing::Values(
std::make_tuple(false, false, WRITE_COMMITTED, kOrderedWrite), std::make_tuple(false, false, WRITE_COMMITTED, kOrderedWrite),
@ -56,7 +56,7 @@ INSTANTIATE_TEST_CASE_P(
std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite), std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite),
std::make_tuple(false, false, WRITE_UNPREPARED, kOrderedWrite), std::make_tuple(false, false, WRITE_UNPREPARED, kOrderedWrite),
std::make_tuple(false, true, WRITE_UNPREPARED, kOrderedWrite))); std::make_tuple(false, true, WRITE_UNPREPARED, kOrderedWrite)));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
StackableDBAsBaseDB, TransactionTest, StackableDBAsBaseDB, TransactionTest,
::testing::Values( ::testing::Values(
std::make_tuple(true, true, WRITE_COMMITTED, kOrderedWrite), std::make_tuple(true, true, WRITE_COMMITTED, kOrderedWrite),
@ -65,7 +65,7 @@ INSTANTIATE_TEST_CASE_P(
// MySQLStyleTransactionTest takes far too long for valgrind to run. // MySQLStyleTransactionTest takes far too long for valgrind to run.
#ifndef ROCKSDB_VALGRIND_RUN #ifndef ROCKSDB_VALGRIND_RUN
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
MySQLStyleTransactionTest, MySQLStyleTransactionTest, MySQLStyleTransactionTest, MySQLStyleTransactionTest,
::testing::Values( ::testing::Values(
std::make_tuple(false, false, WRITE_COMMITTED, kOrderedWrite, false), std::make_tuple(false, false, WRITE_COMMITTED, kOrderedWrite, false),

View File

@ -584,7 +584,7 @@ class SeqAdvanceConcurrentTest
size_t split_cnt_; size_t split_cnt_;
}; };
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
WritePreparedTransaction, WritePreparedTransactionTest, WritePreparedTransaction, WritePreparedTransactionTest,
::testing::Values( ::testing::Values(
std::make_tuple(false, false, WRITE_PREPARED, kOrderedWrite), std::make_tuple(false, false, WRITE_PREPARED, kOrderedWrite),
@ -592,7 +592,7 @@ INSTANTIATE_TEST_CASE_P(
std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite))); std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite)));
#ifndef ROCKSDB_VALGRIND_RUN #ifndef ROCKSDB_VALGRIND_RUN
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
TwoWriteQueues, SnapshotConcurrentAccessTest, TwoWriteQueues, SnapshotConcurrentAccessTest,
::testing::Values( ::testing::Values(
std::make_tuple(false, true, WRITE_PREPARED, kOrderedWrite, 0, 20), std::make_tuple(false, true, WRITE_PREPARED, kOrderedWrite, 0, 20),
@ -637,7 +637,7 @@ INSTANTIATE_TEST_CASE_P(
std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite, 18, 20), std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite, 18, 20),
std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite, 19, 20))); std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite, 19, 20)));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
OneWriteQueue, SnapshotConcurrentAccessTest, OneWriteQueue, SnapshotConcurrentAccessTest,
::testing::Values( ::testing::Values(
std::make_tuple(false, false, WRITE_PREPARED, kOrderedWrite, 0, 20), std::make_tuple(false, false, WRITE_PREPARED, kOrderedWrite, 0, 20),
@ -661,7 +661,7 @@ INSTANTIATE_TEST_CASE_P(
std::make_tuple(false, false, WRITE_PREPARED, kOrderedWrite, 18, 20), std::make_tuple(false, false, WRITE_PREPARED, kOrderedWrite, 18, 20),
std::make_tuple(false, false, WRITE_PREPARED, kOrderedWrite, 19, 20))); std::make_tuple(false, false, WRITE_PREPARED, kOrderedWrite, 19, 20)));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
TwoWriteQueues, SeqAdvanceConcurrentTest, TwoWriteQueues, SeqAdvanceConcurrentTest,
::testing::Values( ::testing::Values(
std::make_tuple(false, true, WRITE_PREPARED, kOrderedWrite, 0, 10), std::make_tuple(false, true, WRITE_PREPARED, kOrderedWrite, 0, 10),
@ -685,7 +685,7 @@ INSTANTIATE_TEST_CASE_P(
std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite, 8, 10), std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite, 8, 10),
std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite, 9, 10))); std::make_tuple(false, true, WRITE_PREPARED, kUnorderedWrite, 9, 10)));
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
OneWriteQueue, SeqAdvanceConcurrentTest, OneWriteQueue, SeqAdvanceConcurrentTest,
::testing::Values( ::testing::Values(
std::make_tuple(false, false, WRITE_PREPARED, kOrderedWrite, 0, 10), std::make_tuple(false, false, WRITE_PREPARED, kOrderedWrite, 0, 10),

View File

@ -31,7 +31,7 @@ class WriteUnpreparedTransactionTest
std::get<2>(GetParam())){} std::get<2>(GetParam())){}
}; };
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
WriteUnpreparedTransactionTest, WriteUnpreparedTransactionTest, WriteUnpreparedTransactionTest, WriteUnpreparedTransactionTest,
::testing::Values(std::make_tuple(false, false, WRITE_UNPREPARED), ::testing::Values(std::make_tuple(false, false, WRITE_UNPREPARED),
std::make_tuple(false, true, WRITE_UNPREPARED))); std::make_tuple(false, true, WRITE_UNPREPARED)));
@ -48,7 +48,7 @@ class WriteUnpreparedStressTest : public WriteUnpreparedTransactionTestBase,
StressAction action_; StressAction action_;
}; };
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_SUITE_P(
WriteUnpreparedStressTest, WriteUnpreparedStressTest, WriteUnpreparedStressTest, WriteUnpreparedStressTest,
::testing::Values(std::make_tuple(false, NO_SNAPSHOT), ::testing::Values(std::make_tuple(false, NO_SNAPSHOT),
std::make_tuple(false, RO_SNAPSHOT), std::make_tuple(false, RO_SNAPSHOT),