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


##########
cpp/src/arrow/filesystem/s3fs_test.cc:
##########
@@ -1579,5 +1612,26 @@ TEST(S3GlobalOptions, DefaultsLogLevel) {
   }
 }
 
+TEST(CalculateSSECKeyMD5, Sanity) {
+  ASSERT_FALSE(CalculateSSECKeyMD5("").ok());  // invalid length
+  ASSERT_FALSE(CalculateSSECKeyMD5("1234567890123456789012345678901234567890")
+                   .ok());  // invalid length
+  // valid case, with ascii input key
+  ASSERT_OK_AND_ASSIGN(auto result,
+                       CalculateSSECKeyMD5("NLbTMHZn9aCW3Li3ViAdBsoIldPCREw1"))
+  ASSERT_STREQ(result.c_str(),
+               "ZWMxZGUyOTZhMDQwZWJmM2Q4N2E4ZTczZjdlNmI3Mzk=");  // valid case
+  // valid case, with some non-ASCII character and a null byte in the 
sse_customer_key

Review Comment:
   is there any side-effect to include both the ascii and non-ascii case? as my 
understanding, non-ascii case would like a case to test whether the 
CalculateSSECustomerKeyMD5 function handle the binary well( in case there are 
some inproper handling depends on the input string is null terminated) while 
the ascii case would like the happy path (also the basic path) i want to cover. 



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to