@@ -191,33 +191,33 @@ TEST(FlightTypes, FlightEndpoint) {
191191 Timestamp expiration_time (
192192 std::chrono::duration_cast<Timestamp::duration>(expiration_time_duration));
193193 std::vector<FlightEndpoint> values = {
194- {{" " }, {}, std::nullopt },
195- {{" foo" }, {}, std::nullopt },
196- {{" bar" }, {}, std::nullopt },
197- {{" foo" }, {}, expiration_time},
198- {{" foo" }, {location1}, std::nullopt },
199- {{" bar" }, {location1}, std::nullopt },
200- {{" foo" }, {location2}, std::nullopt },
201- {{" foo" }, {location1, location2}, std::nullopt },
194+ {{" " }, {}, std::nullopt , {} },
195+ {{" foo" }, {}, std::nullopt , {} },
196+ {{" bar" }, {}, std::nullopt , { " \xDE\xAD\xBE\xEF " } },
197+ {{" foo" }, {}, expiration_time, {} },
198+ {{" foo" }, {location1}, std::nullopt , {} },
199+ {{" bar" }, {location1}, std::nullopt , {} },
200+ {{" foo" }, {location2}, std::nullopt , {} },
201+ {{" foo" }, {location1, location2}, std::nullopt , { " \xba\xdd\xca\xfe " } },
202202 };
203203 std::vector<std::string> reprs = {
204204 " <FlightEndpoint ticket=<Ticket ticket=''> locations=[] "
205- " expiration_time=null>" ,
205+ " expiration_time=null app_metadata='' >" ,
206206 " <FlightEndpoint ticket=<Ticket ticket='foo'> locations=[] "
207- " expiration_time=null>" ,
207+ " expiration_time=null app_metadata='' >" ,
208208 " <FlightEndpoint ticket=<Ticket ticket='bar'> locations=[] "
209- " expiration_time=null>" ,
209+ " expiration_time=null app_metadata='DEADBEEF' >" ,
210210 " <FlightEndpoint ticket=<Ticket ticket='foo'> locations=[] "
211- " expiration_time=2023-06-19 03:14:06.004339000>" ,
211+ " expiration_time=2023-06-19 03:14:06.004339000 app_metadata='' >" ,
212212 " <FlightEndpoint ticket=<Ticket ticket='foo'> locations="
213- " [grpc+tcp://localhost:1024] expiration_time=null>" ,
213+ " [grpc+tcp://localhost:1024] expiration_time=null app_metadata='' >" ,
214214 " <FlightEndpoint ticket=<Ticket ticket='bar'> locations="
215- " [grpc+tcp://localhost:1024] expiration_time=null>" ,
215+ " [grpc+tcp://localhost:1024] expiration_time=null app_metadata='' >" ,
216216 " <FlightEndpoint ticket=<Ticket ticket='foo'> locations="
217- " [grpc+tls://localhost:1024] expiration_time=null>" ,
217+ " [grpc+tls://localhost:1024] expiration_time=null app_metadata='' >" ,
218218 " <FlightEndpoint ticket=<Ticket ticket='foo'> locations="
219219 " [grpc+tcp://localhost:1024, grpc+tls://localhost:1024] "
220- " expiration_time=null>" ,
220+ " expiration_time=null app_metadata='BADDCAFE' >" ,
221221 };
222222
223223 ASSERT_NO_FATAL_FAILURE (TestRoundtrip<pb::FlightEndpoint>(values, reprs));
@@ -229,30 +229,35 @@ TEST(FlightTypes, FlightInfo) {
229229 Schema schema2 ({});
230230 auto desc1 = FlightDescriptor::Command (" foo" );
231231 auto desc2 = FlightDescriptor::Command (" bar" );
232- auto endpoint1 = FlightEndpoint{Ticket{" foo" }, {}, std::nullopt };
233- auto endpoint2 = FlightEndpoint{Ticket{" foo" }, {location}, std::nullopt };
232+ auto endpoint1 = FlightEndpoint{Ticket{" foo" }, {}, std::nullopt , " " };
233+ auto endpoint2 =
234+ FlightEndpoint{Ticket{" foo" }, {location}, std::nullopt , " \xCA\xFE\xD0\x0D " };
234235 std::vector<FlightInfo> values = {
235- MakeFlightInfo (schema1, desc1, {}, -1 , -1 , false ),
236- MakeFlightInfo (schema1, desc2, {}, -1 , -1 , true ),
237- MakeFlightInfo (schema2, desc1, {}, -1 , -1 , false ),
238- MakeFlightInfo (schema1, desc1, {endpoint1}, -1 , 42 , true ),
239- MakeFlightInfo (schema1, desc2, {endpoint1, endpoint2}, 64 , -1 , false ),
236+ MakeFlightInfo (schema1, desc1, {}, -1 , -1 , false , " " ),
237+ MakeFlightInfo (schema1, desc2, {}, -1 , -1 , true , " " ),
238+ MakeFlightInfo (schema2, desc1, {}, -1 , -1 , false , " " ),
239+ MakeFlightInfo (schema1, desc1, {endpoint1}, -1 , 42 , true , " " ),
240+ MakeFlightInfo (schema1, desc2, {endpoint1, endpoint2}, 64 , -1 , false ,
241+ " \xDE\xAD\xC0\xDE " ),
240242 };
241243 std::vector<std::string> reprs = {
242244 " <FlightInfo schema=(serialized) descriptor=<FlightDescriptor cmd='foo'> "
243- " endpoints=[] total_records=-1 total_bytes=-1 ordered=false>" ,
245+ " endpoints=[] total_records=-1 total_bytes=-1 ordered=false app_metadata='' >" ,
244246 " <FlightInfo schema=(serialized) descriptor=<FlightDescriptor cmd='bar'> "
245- " endpoints=[] total_records=-1 total_bytes=-1 ordered=true>" ,
247+ " endpoints=[] total_records=-1 total_bytes=-1 ordered=true app_metadata='' >" ,
246248 " <FlightInfo schema=(serialized) descriptor=<FlightDescriptor cmd='foo'> "
247- " endpoints=[] total_records=-1 total_bytes=-1 ordered=false>" ,
249+ " endpoints=[] total_records=-1 total_bytes=-1 ordered=false app_metadata='' >" ,
248250 " <FlightInfo schema=(serialized) descriptor=<FlightDescriptor cmd='foo'> "
249251 " endpoints=[<FlightEndpoint ticket=<Ticket ticket='foo'> locations=[] "
250- " expiration_time=null>] total_records=-1 total_bytes=42 ordered=true>" ,
252+ " expiration_time=null app_metadata=''>] total_records=-1 total_bytes=42 "
253+ " ordered=true app_metadata=''>" ,
251254 " <FlightInfo schema=(serialized) descriptor=<FlightDescriptor cmd='bar'> "
252255 " endpoints=[<FlightEndpoint ticket=<Ticket ticket='foo'> locations=[] "
253- " expiration_time=null>, <FlightEndpoint ticket=<Ticket ticket='foo'> "
254- " locations=[grpc+tcp://localhost:1234] expiration_time=null>] "
255- " total_records=64 total_bytes=-1 ordered=false>" ,
256+ " expiration_time=null app_metadata=''>, <FlightEndpoint ticket=<Ticket "
257+ " ticket='foo'> "
258+ " locations=[grpc+tcp://localhost:1234] expiration_time=null "
259+ " app_metadata='CAFED00D'>] "
260+ " total_records=64 total_bytes=-1 ordered=false app_metadata='DEADC0DE'>" ,
256261 };
257262
258263 ASSERT_NO_FATAL_FAILURE (TestRoundtrip<pb::FlightInfo>(values, reprs));
@@ -262,8 +267,8 @@ TEST(FlightTypes, PollInfo) {
262267 ASSERT_OK_AND_ASSIGN (auto location, Location::ForGrpcTcp (" localhost" , 1234 ));
263268 Schema schema ({field (" ints" , int64 ())});
264269 auto desc = FlightDescriptor::Command (" foo" );
265- auto endpoint = FlightEndpoint{Ticket{" foo" }, {}, std::nullopt };
266- auto info = MakeFlightInfo (schema, desc, {endpoint}, -1 , 42 , true );
270+ auto endpoint = FlightEndpoint{Ticket{" foo" }, {}, std::nullopt , " " };
271+ auto info = MakeFlightInfo (schema, desc, {endpoint}, -1 , 42 , true , " " );
267272 // 2023-06-19 03:14:06.004330100
268273 // We must use microsecond resolution here for portability.
269274 // std::chrono::system_clock::time_point may not provide nanosecond
0 commit comments