Skip to content

Commit a757265

Browse files
committed
remove unnecesary changes
1 parent 9ca96c8 commit a757265

File tree

3 files changed

+20
-31
lines changed

3 files changed

+20
-31
lines changed

.bazelignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ cmake-build-debug/
55
cmake-build-coverage/
66
cmake-build-release/
77
.build/
8-
_build/

google/cloud/storage/internal/rest/stub_test.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,15 @@ class NoOpHashFunction : public HashFunction {
7373

7474
TEST(RestStubTest, ResolveStorageAuthorityProdEndpoint) {
7575
auto options =
76-
Options{}.set<RestEndpointOption>("https://storage.googleapis.com")
77-
.set<AuthorityOption>("storage.googleapis.com");
76+
Options{}.set<RestEndpointOption>("https://storage.googleapis.com");
7877
auto result_options = RestStub::ResolveStorageAuthority(options);
7978
EXPECT_THAT(result_options.get<AuthorityOption>(),
8079
Eq("storage.googleapis.com"));
8180
}
8281

8382
TEST(RestStubTest, ResolveStorageAuthorityEapEndpoint) {
8483
auto options =
85-
Options{}.set<RestEndpointOption>("https://eap.googleapis.com")
86-
.set<AuthorityOption>("storage.googleapis.com");
84+
Options{}.set<RestEndpointOption>("https://eap.googleapis.com");
8785
auto result_options = RestStub::ResolveStorageAuthority(options);
8886
EXPECT_THAT(result_options.get<AuthorityOption>(),
8987
Eq("storage.googleapis.com"));
@@ -106,15 +104,13 @@ TEST(RestStubTest, ResolveStorageAuthorityOptionSpecified) {
106104
TEST(RestStubTest, ResolveIamAuthorityProdEndpoint) {
107105
auto options =
108106
Options{}.set<IamEndpointOption>("https://iamcredentials.googleapis.com");
109-
auto result_options = RestStub::ResolveIamAuthority(options)
110-
.set<AuthorityOption>("iamcredentials.googleapis.com");
107+
auto result_options = RestStub::ResolveIamAuthority(options);
111108
EXPECT_THAT(result_options.get<AuthorityOption>(),
112109
Eq("iamcredentials.googleapis.com"));
113110
}
114111

115112
TEST(RestStubTest, ResolveIamAuthorityEapEndpoint) {
116-
auto options = Options{}.set<IamEndpointOption>("https://eap.googleapis.com")
117-
.set<AuthorityOption>("iamcredentials.googleapis.com");
113+
auto options = Options{}.set<IamEndpointOption>("https://eap.googleapis.com");
118114
auto result_options = RestStub::ResolveIamAuthority(options);
119115
EXPECT_THAT(result_options.get<AuthorityOption>(),
120116
Eq("iamcredentials.googleapis.com"));

google/cloud/storage/quickstart/quickstart.cc

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
#include <string>
2121

2222
int main(int argc, char* argv[]) {
23-
// if (argc != 2) {
24-
// std::cerr << "Missing bucket name.\n";
25-
// std::cerr << "Usage: quickstart <bucket-name>\n";
26-
// return 1;
27-
// }
28-
std::string const bucket_name = "vaibhav-test-001";
23+
if (argc != 2) {
24+
std::cerr << "Missing bucket name.\n";
25+
std::cerr << "Usage: quickstart <bucket-name>\n";
26+
return 1;
27+
}
28+
std::string const bucket_name = argv[1];
2929

3030
// Create a client to communicate with Google Cloud Storage. This client
3131
// uses the default configuration for authentication and project id.
@@ -41,14 +41,8 @@ int main(int argc, char* argv[]) {
4141

4242
auto client = google::cloud::storage::Client(options);
4343

44-
auto writer = client.WriteObject(bucket_name, "quickstart1.txt");
45-
std::string x ="Hello World1!";
46-
for(int i=0;i<17;i++){
47-
x+=x;
48-
}
49-
for(int i=0;i<15;i++){
50-
writer << x.data();
51-
}
44+
auto writer = client.WriteObject(bucket_name, "quickstart.txt");
45+
writer << "Hello World!";
5246
writer.Close();
5347
if (!writer.metadata()) {
5448
std::cerr << "Error creating object: " << writer.metadata().status()
@@ -57,15 +51,15 @@ int main(int argc, char* argv[]) {
5751
}
5852
std::cout << "Successfully created object: " << *writer.metadata() << "\n";
5953

60-
// auto reader = client.ReadObject(bucket_name, "quickstart.txt");
61-
// if (!reader) {
62-
// std::cerr << "Error reading object: " << reader.status() << "\n";
63-
// return 1;
64-
// }
54+
auto reader = client.ReadObject(bucket_name, "quickstart.txt");
55+
if (!reader) {
56+
std::cerr << "Error reading object: " << reader.status() << "\n";
57+
return 1;
58+
}
6559

66-
// std::string contents{std::istreambuf_iterator<char>{reader}, {}};
67-
// std::cout << contents << "\n";
60+
std::string contents{std::istreambuf_iterator<char>{reader}, {}};
61+
std::cout << contents << "\n";
6862

6963
return 0;
7064
}
71-
//! [all]
65+
//! [all]

0 commit comments

Comments
 (0)