kou commented on code in PR #43601:
URL: https://github.com/apache/arrow/pull/43601#discussion_r1741558748


##########
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:
   I think that `ASSERT_STREQ()` is for C (string) not C++.
   If we can use `std::string`, we should use `ASSERT_EQ()` instead of 
`ASSERT_STREQ()`.
   
   I think that `ASSERT_EQ()` shows a developer friendly failure message too 
with `std::string`.



-- 
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]

Reply via email to