Skip to content

Commit

Permalink
fix the ut error
Browse files Browse the repository at this point in the history
  • Loading branch information
Hang Zheng committed Aug 27, 2024
1 parent 539fa7c commit 4f813a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cpp/src/arrow/filesystem/filesystem_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ TEST(CalculateSSECKeyMD5, Sanity) {
ASSERT_FALSE(CalculateSSECKeyMD5("", lResult)); // invalid base64
ASSERT_FALSE(CalculateSSECKeyMD5("%^H", lResult)); // invalid base64
ASSERT_FALSE(CalculateSSECKeyMD5("INVALID", lResult)); // invalid base64
ASSERT_FALSE(CalculateSSECKeyMD5("MTIzNDU2Nzg5", lResult)); // not, match 32 bytes
ASSERT_FALSE(CalculateSSECKeyMD5("MTIzNDU2Nzg5", lResult)); // invalid, the input key size not match
ASSERT_TRUE(CalculateSSECKeyMD5("1WH9aTJ0+Tn0NLbTMHZn9aCW3Li3ViAdBsoIldPCREw=", lResult)); // valid case
}

Expand Down
7 changes: 6 additions & 1 deletion cpp/src/arrow/filesystem/util_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ ARROW_EXPORT
Result<FileInfoVector> GlobFiles(const std::shared_ptr<FileSystem>& filesystem,
const std::string& glob);


/// \brief Decode the Input SSE key,calculate the MD5
/// \param base64_encoded_key is the input base64 encoded sse key
/// \param md5_result, output resut
/// \param expect_input_key_size, default 32
/// \return true if the decode and calculate MD5 success, otherwise return false
ARROW_EXPORT
bool CalculateSSECKeyMD5(const std::string& base64_encoded_key, std::string& md5_result,
int expect_input_key_size = 32);

Expand Down

0 comments on commit 4f813a7

Please sign in to comment.