Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
coryan committed Jun 27, 2024
1 parent 2ab1e6b commit 1e2943c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions google/cloud/storage/tests/object_file_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ namespace {
using ::google::cloud::testing_util::IsOk;
using ::google::cloud::testing_util::StatusIs;
using ::testing::AnyOf;
using ::testing::Contains;
using ::testing::ElementsAreArray;
using ::testing::Eq;
using ::testing::HasSubstr;
using ::testing::Not;
using ::testing::Pair;

class ObjectFileIntegrationTest
: public google::cloud::storage::testing::StorageIntegrationTest {
Expand Down Expand Up @@ -552,9 +554,8 @@ TEST_F(ObjectFileIntegrationTest, ResumableUploadFileCustomHeader) {
auto expected_str = expected.str();
ASSERT_EQ(expected_str.size(), meta->size());

EXPECT_THAT(meta->metadata(),
::testing::Contains(::testing::Pair("x_emulator_custom_header",
"custom_header_value")));
EXPECT_THAT(meta->metadata(), Contains(Pair("x_emulator_custom_header",
"custom_header_value")));

// Create an iostream to read the object back.
auto stream = client->ReadObject(bucket_name_, object_name);
Expand Down
5 changes: 3 additions & 2 deletions google/cloud/storage/tests/object_hash_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,13 @@ TEST_F(ObjectHashIntegrationTest, WriteObjectExplicitEnable) {
EXPECT_THAT(os.computed_hash(), HasSubstr(ComputeMD5Hash(LoremIpsum())));
EXPECT_THAT(os.received_hash(), HasSubstr(ComputeMD5Hash(LoremIpsum())));
if (meta->has_metadata("x_emulator_upload")) {
ASSERT_THAT(meta->metadata(), Contains(Pair("x_emulator_no_crc32c", _)));
if (UsingGrpc()) {
EXPECT_THAT(meta->metadata(), Contains(Pair("x_emulator_no_crc32c", _)));
EXPECT_THAT(meta->metadata(), Contains(Pair("x_emulator_md5", _)));
} else {
// REST cannot send the checksums computed at the end of the upload.
ASSERT_THAT(meta->metadata(), Contains(Pair("x_emulator_no_md5", _)));
EXPECT_THAT(meta->metadata(), Contains(Pair("x_emulator_no_crc32c", _)));
EXPECT_THAT(meta->metadata(), Contains(Pair("x_emulator_no_md5", _)));
}
}
}
Expand Down

0 comments on commit 1e2943c

Please sign in to comment.