Skip to content

Commit d5c8568

Browse files
committed
fix tests without zstd
1 parent 28a3998 commit d5c8568

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

cpp/src/arrow/util/compression_test.cc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,11 +452,12 @@ TEST(TestCodecMisc, SpecifyCompressionLevel) {
452452
template <std::derived_from<arrow::util::CodecOptions> T>
453453
void CheckSpecifyCodecOptions(Compression::type compression,
454454
std::span<const std::pair<T, bool>> options) {
455+
if (!Codec::IsAvailable(compression)) {
456+
GTEST_SKIP() << "Support for this codec hasn't been built";
457+
}
458+
455459
std::vector<uint8_t> data = MakeRandomData(2000);
456460
for (const auto& [codec_option, expect_success] : options) {
457-
if (!Codec::IsAvailable(compression)) {
458-
GTEST_SKIP() << "Support for this codec hasn't been built";
459-
}
460461
auto result1 = Codec::Create(compression, codec_option);
461462
auto result2 = Codec::Create(compression, codec_option);
462463
ASSERT_EQ(expect_success, result1.ok());
@@ -523,6 +524,10 @@ TEST(TestCodecMisc, SpecifyCodecOptionsZstd) {
523524
}
524525

525526
TEST(TestCodecMisc, ZstdLargerWindowLog) {
527+
#ifndef ARROW_WITH_ZSTD
528+
GTEST_SKIP() << "Test requires Zstd compression";
529+
#endif
530+
526531
constexpr int ZSTD_c_windowLog = 101;
527532

528533
arrow::util::ZstdCodecOptions option1;
@@ -552,6 +557,10 @@ TEST(TestCodecMisc, ZstdLargerWindowLog) {
552557
}
553558

554559
TEST(TestCodecMisc, ZstdStreamLargerWindowLog) {
560+
#ifndef ARROW_WITH_ZSTD
561+
GTEST_SKIP() << "Test requires Zstd compression";
562+
#endif
563+
555564
constexpr int ZSTD_c_windowLog = 101;
556565
constexpr int ZSTD_d_windowLogMax = 100;
557566

0 commit comments

Comments
 (0)