Skip to content

Commit

Permalink
#Centipede Add and update tests in blob_file_test for conditional R…
Browse files Browse the repository at this point in the history
…iegeli build.

PiperOrigin-RevId: 590174512
  • Loading branch information
v-ramesh authored and copybara-github committed Dec 13, 2023
1 parent 2e87880 commit 4b2ef96
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions centipede/blob_file_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ TEST_P(BlobFile, IncorrectUsage) {
&DefaultBlobFileWriterFactory, GetParam());
}

#ifndef CENTIPEDE_DISABLE_RIEGELI
INSTANTIATE_TEST_SUITE_P(BlobFileTests, BlobFile, ::testing::Bool());
#else
INSTANTIATE_TEST_SUITE_P(BlobFileTests, BlobFile, ::testing::Values(false));
#endif // CENTIPEDE_DISABLE_RIEGELI

class ReadMultipleFiles
: public testing::TestWithParam<std::tuple<bool, bool>> {};
Expand Down Expand Up @@ -229,9 +233,20 @@ TEST_P(ReadMultipleFiles, SingleObjectMultipleFormats) {
EXPECT_OK(reader->Close());
}

#ifndef CENTIPEDE_DISABLE_RIEGELI
INSTANTIATE_TEST_SUITE_P(DefaultBlobFileReaderTests, ReadMultipleFiles,
::testing::Combine(::testing::Bool(),
::testing::Bool()));
#else
INSTANTIATE_TEST_SUITE_P(DefaultBlobFileReaderTests, ReadMultipleFiles,
::testing::Values(std::tuple{false, false}));
#endif // CENTIPEDE_DISABLE_RIEGELI

#ifdef CENTIPEDE_DISABLE_RIEGELI
TEST(WriterFactoryDeathTest, FailWhenBuiltWithoutRiegeli) {
ASSERT_DEATH(DefaultBlobFileWriterFactory(true), "");
}
#endif // CENTIPEDE_DISABLE_RIEGELI

} // namespace
} // namespace centipede

0 comments on commit 4b2ef96

Please sign in to comment.