coryan commented on a change in pull request #11436:
URL: https://github.com/apache/arrow/pull/11436#discussion_r732216324
##########
File path: cpp/src/arrow/filesystem/gcsfs_test.cc
##########
@@ -159,11 +183,82 @@ TEST(GcsFileSystem, FileSystemCompare) {
EXPECT_FALSE(a->Equals(*b));
}
-TEST_F(GcsIntegrationTest, MakeBucket) {
+TEST_F(GcsIntegrationTest, GetFileInfoBucket) {
auto fs = internal::MakeGcsFileSystemForTest(TestGcsOptions());
arrow::fs::AssertFileInfo(fs.get(), kPreexistingBucket, FileType::Directory);
}
+TEST_F(GcsIntegrationTest, GetFileInfoObject) {
+ auto fs = internal::MakeGcsFileSystemForTest(TestGcsOptions());
+ arrow::fs::AssertFileInfo(fs.get(), PreexistingObjectPath(), FileType::File);
+}
+
+TEST_F(GcsIntegrationTest, ReadObjectString) {
+ auto fs = internal::MakeGcsFileSystemForTest(TestGcsOptions());
+
+ std::shared_ptr<io::InputStream> stream;
+ ASSERT_OK_AND_ASSIGN(stream, fs->OpenInputStream(PreexistingObjectPath()));
+
+ std::array<char, 1024> buffer{};
+ std::int64_t size;
+ ASSERT_OK_AND_ASSIGN(size, stream->Read(buffer.size(), buffer.data()));
+
+ EXPECT_EQ(std::string(buffer.data(), size), kLoremIpsum);
+}
+
+TEST_F(GcsIntegrationTest, ReadObjectStringBuffers) {
+ auto fs = internal::MakeGcsFileSystemForTest(TestGcsOptions());
+
+ std::shared_ptr<io::InputStream> stream;
+ ASSERT_OK_AND_ASSIGN(stream, fs->OpenInputStream(PreexistingObjectPath()));
+
+ std::string contents;
+ for (Result<std::shared_ptr<Buffer>> r = stream->Read(16); r.ok() &&
(*r)->size() != 0;
+ r = stream->Read(16)) {
+ auto buffer = *r;
Review comment:
I think I did what you wanted, let me know if I missed the mark.
--
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]