ripplehang commented on code in PR #43601:
URL: https://github.com/apache/arrow/pull/43601#discussion_r1741507965
##########
cpp/src/arrow/filesystem/filesystem_test.cc:
##########
@@ -54,6 +54,17 @@ TEST(FileInfo, BaseName) {
ASSERT_EQ(info.base_name(), "baz.qux");
}
+TEST(CalculateSSECKeyMD5, Sanity) {
+ ASSERT_FALSE(CalculateSSECKeyMD5("").ok()); // invalid base64
+ ASSERT_FALSE(CalculateSSECKeyMD5("%^H").ok()); // invalid base64
+ ASSERT_FALSE(CalculateSSECKeyMD5("INVALID").ok()); // invalid base64
+ ASSERT_FALSE(CalculateSSECKeyMD5("MTIzNDU2Nzg5").ok()); // invalid, the
input key size not match
+ // valid case
+ auto result =
CalculateSSECKeyMD5("1WH9aTJ0+Tn0NLbTMHZn9aCW3Li3ViAdBsoIldPCREw=");
+ ASSERT_TRUE(result.ok()); // valid case
Review Comment:
done
##########
cpp/src/arrow/filesystem/filesystem_test.cc:
##########
@@ -54,6 +54,17 @@ TEST(FileInfo, BaseName) {
ASSERT_EQ(info.base_name(), "baz.qux");
}
+TEST(CalculateSSECKeyMD5, Sanity) {
+ ASSERT_FALSE(CalculateSSECKeyMD5("").ok()); // invalid base64
+ ASSERT_FALSE(CalculateSSECKeyMD5("%^H").ok()); // invalid base64
+ ASSERT_FALSE(CalculateSSECKeyMD5("INVALID").ok()); // invalid base64
+ ASSERT_FALSE(CalculateSSECKeyMD5("MTIzNDU2Nzg5").ok()); // invalid, the
input key size not match
+ // valid case
+ auto result =
CalculateSSECKeyMD5("1WH9aTJ0+Tn0NLbTMHZn9aCW3Li3ViAdBsoIldPCREw=");
+ ASSERT_TRUE(result.ok()); // valid case
+ ASSERT_STREQ(result->c_str(), "3HYIM58NCLwrIOdPpWnYwQ=="); // valid case
Review Comment:
Is there any other benefit to use the ASSERT_EQ()? for the EQ, if the result
and baseline are not match, it would print the result which may be more
friendly for developer to find the cause of the failure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]