Skip to content

Commit 07b91fc

Browse files
committed
remove unnecesary changes
1 parent 518a55f commit 07b91fc

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
@@ -18,25 +18,19 @@
1818
#include <string>
1919

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

2828
// Create a client to communicate with Google Cloud Storage. This client
2929
// uses the default configuration for authentication and project id.
3030
auto client = google::cloud::storage::Client();
3131

32-
auto writer = client.WriteObject(bucket_name, "quickstart1.txt");
33-
std::string x ="Hello World1!";
34-
for(int i=0;i<17;i++){
35-
x+=x;
36-
}
37-
for(int i=0;i<15;i++){
38-
writer << x.data();
39-
}
32+
auto writer = client.WriteObject(bucket_name, "quickstart.txt");
33+
writer << "Hello World!";
4034
writer.Close();
4135
if (!writer.metadata()) {
4236
std::cerr << "Error creating object: " << writer.metadata().status()
@@ -45,15 +39,15 @@ int main(int argc, char* argv[]) {
4539
}
4640
std::cout << "Successfully created object: " << *writer.metadata() << "\n";
4741

48-
// auto reader = client.ReadObject(bucket_name, "quickstart.txt");
49-
// if (!reader) {
50-
// std::cerr << "Error reading object: " << reader.status() << "\n";
51-
// return 1;
52-
// }
42+
auto reader = client.ReadObject(bucket_name, "quickstart.txt");
43+
if (!reader) {
44+
std::cerr << "Error reading object: " << reader.status() << "\n";
45+
return 1;
46+
}
5347

54-
// std::string contents{std::istreambuf_iterator<char>{reader}, {}};
55-
// std::cout << contents << "\n";
48+
std::string contents{std::istreambuf_iterator<char>{reader}, {}};
49+
std::cout << contents << "\n";
5650

5751
return 0;
5852
}
59-
//! [all]
53+
//! [all]

0 commit comments

Comments
 (0)