emkornfield commented on a change in pull request #11375:
URL: https://github.com/apache/arrow/pull/11375#discussion_r726576287
##########
File path: cpp/src/arrow/filesystem/gcsfs_test.cc
##########
@@ -45,6 +99,48 @@ TEST(GcsFileSystem, OptionsCompare) {
EXPECT_FALSE(b.Equals(c));
}
+TEST(GcsFileSystem, ToArrowStatusOK) {
+ Status actual = internal::ToArrowStatus(google::cloud::Status());
+ EXPECT_TRUE(actual.ok());
+}
+
+TEST(GcsFileSystem, ToArrowStatus) {
+ struct {
+ google::cloud::StatusCode input;
+ arrow::StatusCode expected;
+ } cases[] = {
+ {google::cloud::StatusCode::kCancelled, StatusCode::Cancelled},
+ {google::cloud::StatusCode::kUnknown, StatusCode::UnknownError},
+ {google::cloud::StatusCode::kInvalidArgument, StatusCode::Invalid},
+ {google::cloud::StatusCode::kDeadlineExceeded, StatusCode::UnknownError},
+ {google::cloud::StatusCode::kNotFound, StatusCode::UnknownError},
+ {google::cloud::StatusCode::kAlreadyExists, StatusCode::AlreadyExists},
+ {google::cloud::StatusCode::kPermissionDenied, StatusCode::UnknownError},
+ {google::cloud::StatusCode::kUnauthenticated, StatusCode::UnknownError},
+ {google::cloud::StatusCode::kResourceExhausted,
StatusCode::CapacityError},
+ {google::cloud::StatusCode::kFailedPrecondition,
StatusCode::UnknownError},
+ {google::cloud::StatusCode::kAborted, StatusCode::UnknownError},
+ {google::cloud::StatusCode::kOutOfRange, StatusCode::Invalid},
+ {google::cloud::StatusCode::kUnimplemented, StatusCode::NotImplemented},
+ {google::cloud::StatusCode::kInternal, StatusCode::UnknownError},
+ {google::cloud::StatusCode::kUnavailable, StatusCode::UnknownError},
+ {google::cloud::StatusCode::kDataLoss, StatusCode::UnknownError},
+ };
+
+ for (const auto& test : cases) {
+ auto status = google::cloud::Status(test.input, "test-message");
+ auto message = [&] {
+ std::ostringstream os;
+ os << status;
+ return os.str();
+ }();
+ SCOPED_TRACE("Testing with status=" + message);
Review comment:
nice, learned something new.
--
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]