Skip to content

Commit a63dab4

Browse files
authored
Get tests passing on Linux (#4275)
* Fix build on Linux * Fix pretty-printing test on Linux
1 parent 69d39f6 commit a63dab4

File tree

2 files changed

+26
-27
lines changed

2 files changed

+26
-27
lines changed

Firestore/core/src/firebase/firestore/remote/remote_objc_bridge.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ using nanopb::Message;
5252
using nanopb::Reader;
5353
using remote::ByteBufferReader;
5454
using remote::Serializer;
55-
using util::MakeString;
5655
using util::Status;
5756
using util::StatusOr;
5857
using util::StringFormat;

Firestore/core/test/firebase/firestore/nanopb/pretty_printing_test.cc

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ using ::testing::MatchesRegex;
4545
// `contents`.
4646
MATCHER_P2(IsPrintedAs, proto_name, contents, "") {
4747
// NOLINTNEXTLINE(whitespace/braces)
48-
std::string header = std::string{"<"} + proto_name + " 0x[0-9A-Fa-f]+>: {";
49-
std::string expected = header + contents + "}";
48+
std::string header = std::string{"<"} + proto_name + " 0x[0-9A-Fa-f]+>: \\{";
49+
std::string expected = header + contents + "\\}";
5050
return testing::Value(arg, MatchesRegex(expected));
5151
}
5252

@@ -102,10 +102,10 @@ TEST(PrettyPrintingTest, PrintsSubmessages) {
102102
m->snapshot_version.nanos = 456;
103103

104104
EXPECT_THAT(m.ToString(), IsPrintedAs("Target", R"(
105-
snapshot_version {
105+
snapshot_version \{
106106
seconds: 123
107107
nanos: 456
108-
}
108+
\}
109109
)"));
110110
}
111111

@@ -136,14 +136,14 @@ TEST(PrettyPrintingTest, PrintsArraysOfObjects) {
136136
m->labels[1].value = MakeBytesArray("value2");
137137

138138
EXPECT_THAT(m.ToString(), IsPrintedAs("ListenRequest", R"(
139-
labels {
139+
labels \{
140140
key: "key1"
141141
value: "value1"
142-
}
143-
labels {
142+
\}
143+
labels \{
144144
key: "key2"
145145
value: "value2"
146-
}
146+
\}
147147
)"));
148148
}
149149

@@ -182,22 +182,22 @@ TEST(PrettyPrintingTest, PrintsMessagesInOneofs) {
182182
google_firestore_v1_Value_timestamp_value_tag;
183183

184184
EXPECT_THAT(m.ToString(), IsPrintedAs("Write", R"(
185-
update {
185+
update \{
186186
name: "some name"
187-
fields {
187+
fields \{
188188
key: "key1"
189-
value {
189+
value \{
190190
boolean_value: false
191-
}
192-
}
193-
fields {
191+
\}
192+
\}
193+
fields \{
194194
key: "key2"
195-
value {
196-
timestamp_value {
197-
}
198-
}
199-
}
200-
}
195+
value \{
196+
timestamp_value \{
197+
\}
198+
\}
199+
\}
200+
\}
201201
)"));
202202
}
203203

@@ -209,10 +209,10 @@ TEST(PrettyPrintingTest, PrintsNonAnonymousOneofs) {
209209
m->consistency_selector.read_time.seconds = 123;
210210
m->consistency_selector.read_time.nanos = 456;
211211
EXPECT_THAT(m.ToString(), IsPrintedAs("RunQueryRequest", R"(
212-
read_time {
212+
read_time \{
213213
seconds: 123
214214
nanos: 456
215-
}
215+
\}
216216
)"));
217217
}
218218

@@ -232,10 +232,10 @@ TEST(PrettyPrintingTest, PrintsOptionals) {
232232

233233
m->has_update_mask = true;
234234
EXPECT_THAT(m.ToString(), IsPrintedAs("Write", R"(
235-
update_mask {
235+
update_mask \{
236236
field_paths: "abc"
237237
field_paths: "def"
238-
}
238+
\}
239239
)"));
240240
}
241241

@@ -246,8 +246,8 @@ TEST(PrettyPrintingTest, PrintsEmptyOptionals) {
246246
// When set, an optional submessage should always be printed, even if it's
247247
// "empty".
248248
EXPECT_THAT(m.ToString(), IsPrintedAs("Write", R"(
249-
update_mask {
250-
}
249+
update_mask \{
250+
\}
251251
)"));
252252
}
253253

0 commit comments

Comments
 (0)