Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions cpp/src/parquet/types_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <gtest/gtest.h>

#include <magic_enum/magic_enum.hpp>
#include <string>

#include "arrow/util/endian.h"
Expand Down Expand Up @@ -213,9 +214,12 @@ TEST(TestInt96Timestamp, Decoding) {
}

TEST(TestIsParquetCipherSupported, SupportedCiphers) {
ASSERT_TRUE(IsParquetCipherSupported(ParquetCipher::AES_GCM_V1));
ASSERT_TRUE(IsParquetCipherSupported(ParquetCipher::AES_GCM_CTR_V1));
ASSERT_TRUE(IsParquetCipherSupported(ParquetCipher::EXTERNAL_DBPA_V1));
std::size_t parquet_cipher_enum_size = magic_enum::enum_count<ParquetCipher::type>();
EXPECT_EQ(parquet_cipher_enum_size, 3) << "Expected 3 parquet cipher types";

for (auto cipher : magic_enum::enum_values<ParquetCipher::type>()) {
ASSERT_TRUE(IsParquetCipherSupported(cipher));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of doing this, I'd keep the original check (asserting for each individual known Cipher). This way we guarantee that test will break is a cipher is accidentally replaced by another.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

}

#if !(defined(_WIN32) || defined(__CYGWIN__))
Expand Down
Loading