Lines Matching refs:message
53 unittest::TestAllTypes message; in TEST() local
55 TestUtil::SetAllFields(&message); in TEST()
56 TestUtil::ExpectAllFieldsSet(message); in TEST()
60 unittest::TestAllTypes message, message2; in TEST() local
62 TestUtil::SetAllFields(&message); in TEST()
64 ReflectionOps::Copy(message, &message2); in TEST()
74 unittest::TestAllExtensions message, message2; in TEST() local
76 TestUtil::SetAllExtensions(&message); in TEST()
78 ReflectionOps::Copy(message, &message2); in TEST()
84 unittest::TestOneof2 message, message2; in TEST() local
85 TestUtil::SetOneof1(&message); in TEST()
86 ReflectionOps::Copy(message, &message2); in TEST()
89 TestUtil::SetOneof2(&message); in TEST()
90 TestUtil::ExpectOneofSet2(message); in TEST()
91 ReflectionOps::Copy(message, &message2); in TEST()
99 unittest::TestAllTypes message, message2; in TEST() local
101 TestUtil::SetAllFields(&message); in TEST()
104 message2.set_optional_int32(message.optional_int32()); in TEST()
105 message.clear_optional_int32(); in TEST()
108 message2.set_optional_string(message.optional_string()); in TEST()
109 message.set_optional_string("something else"); in TEST()
112 message2.add_repeated_int32(message.repeated_int32(1)); in TEST()
113 int32 i = message.repeated_int32(0); in TEST()
114 message.clear_repeated_int32(); in TEST()
115 message.add_repeated_int32(i); in TEST()
117 ReflectionOps::Merge(message2, &message); in TEST()
119 TestUtil::ExpectAllFieldsSet(message); in TEST()
126 unittest::TestAllExtensions message, message2; in TEST() local
128 TestUtil::SetAllExtensions(&message); in TEST()
133 message.GetExtension(unittest::optional_int32_extension)); in TEST()
134 message.ClearExtension(unittest::optional_int32_extension); in TEST()
139 message.GetExtension(unittest::optional_string_extension)); in TEST()
140 message.SetExtension(unittest::optional_string_extension, "something else"); in TEST()
145 message.GetExtension(unittest::repeated_int32_extension, 1)); in TEST()
146 int32 i = message.GetExtension(unittest::repeated_int32_extension, 0); in TEST()
147 message.ClearExtension(unittest::repeated_int32_extension); in TEST()
148 message.AddExtension(unittest::repeated_int32_extension, i); in TEST()
150 ReflectionOps::Merge(message2, &message); in TEST()
152 TestUtil::ExpectAllExtensionsSet(message); in TEST()
196 unittest::TestAllTypes message; in TEST() local
198 EXPECT_DEATH(ReflectionOps::Merge(message, &message), "&from"); in TEST()
204 unittest::TestAllTypes message; in TEST() local
206 TestUtil::SetAllFields(&message); in TEST()
208 ReflectionOps::Clear(&message); in TEST()
210 TestUtil::ExpectClear(message); in TEST()
215 &message.optionalgroup()); in TEST()
217 &message.optional_nested_message()); in TEST()
219 &message.optional_foreign_message()); in TEST()
221 &message.optional_import_message()); in TEST()
225 unittest::TestAllExtensions message; in TEST() local
227 TestUtil::SetAllExtensions(&message); in TEST()
229 ReflectionOps::Clear(&message); in TEST()
231 TestUtil::ExpectExtensionsClear(message); in TEST()
236 &message.GetExtension(unittest::optionalgroup_extension)); in TEST()
238 &message.GetExtension(unittest::optional_nested_message_extension)); in TEST()
241 &message.GetExtension(unittest::optional_foreign_message_extension)); in TEST()
243 &message.GetExtension(unittest::optional_import_message_extension)); in TEST()
248 unittest::TestEmptyMessage message; in TEST() local
249 message.mutable_unknown_fields()->AddVarint(1234, 1); in TEST()
251 ReflectionOps::Clear(&message); in TEST()
253 EXPECT_EQ(0, message.unknown_fields().field_count()); in TEST()
257 unittest::TestOneof2 message; in TEST() local
259 TestUtil::ExpectOneofClear(message); in TEST()
260 TestUtil::SetOneof1(&message); in TEST()
261 TestUtil::ExpectOneofSet1(message); in TEST()
262 ReflectionOps::Clear(&message); in TEST()
263 TestUtil::ExpectOneofClear(message); in TEST()
265 TestUtil::SetOneof1(&message); in TEST()
266 TestUtil::ExpectOneofSet1(message); in TEST()
267 TestUtil::SetOneof2(&message); in TEST()
268 TestUtil::ExpectOneofSet2(message); in TEST()
269 ReflectionOps::Clear(&message); in TEST()
270 TestUtil::ExpectOneofClear(message); in TEST()
274 unittest::TestAllTypes message; in TEST() local
275 TestUtil::SetAllFields(&message); in TEST()
278 message.mutable_unknown_fields()->AddVarint(123456, 654321); in TEST()
279 message.mutable_optional_nested_message() in TEST()
282 message.mutable_repeated_nested_message(0) in TEST()
286 EXPECT_EQ(1, message.unknown_fields().field_count()); in TEST()
288 message.optional_nested_message().unknown_fields().field_count()); in TEST()
290 message.repeated_nested_message(0).unknown_fields().field_count()); in TEST()
293 ReflectionOps::DiscardUnknownFields(&message); in TEST()
294 TestUtil::ExpectAllFieldsSet(message); in TEST()
296 EXPECT_EQ(0, message.unknown_fields().field_count()); in TEST()
298 message.optional_nested_message().unknown_fields().field_count()); in TEST()
300 message.repeated_nested_message(0).unknown_fields().field_count()); in TEST()
304 unittest::TestAllExtensions message; in TEST() local
305 TestUtil::SetAllExtensions(&message); in TEST()
308 message.mutable_unknown_fields()->AddVarint(123456, 654321); in TEST()
309 message.MutableExtension(unittest::optional_nested_message_extension) in TEST()
312 message.MutableExtension(unittest::repeated_nested_message_extension, 0) in TEST()
316 EXPECT_EQ(1, message.unknown_fields().field_count()); in TEST()
317 EXPECT_EQ(1, message.GetExtension(unittest::optional_nested_message_extension) in TEST()
321 message.GetExtension(unittest::repeated_nested_message_extension, 0) in TEST()
326 ReflectionOps::DiscardUnknownFields(&message); in TEST()
327 TestUtil::ExpectAllExtensionsSet(message); in TEST()
329 EXPECT_EQ(0, message.unknown_fields().field_count()); in TEST()
330 EXPECT_EQ(0, message.GetExtension(unittest::optional_nested_message_extension) in TEST()
334 message.GetExtension(unittest::repeated_nested_message_extension, 0) in TEST()
340 unittest::TestRequired message; in TEST() local
342 EXPECT_FALSE(ReflectionOps::IsInitialized(message)); in TEST()
343 EXPECT_FALSE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
344 EXPECT_TRUE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
345 message.set_a(1); in TEST()
346 EXPECT_FALSE(ReflectionOps::IsInitialized(message)); in TEST()
347 EXPECT_FALSE(ReflectionOps::IsInitialized(message, true, true)); in TEST()
348 EXPECT_TRUE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
349 message.set_b(2); in TEST()
350 EXPECT_FALSE(ReflectionOps::IsInitialized(message)); in TEST()
351 EXPECT_FALSE(ReflectionOps::IsInitialized(message, true, true)); in TEST()
352 EXPECT_TRUE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
353 message.set_c(3); in TEST()
354 EXPECT_TRUE(ReflectionOps::IsInitialized(message)); in TEST()
355 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
356 EXPECT_TRUE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
360 unittest::TestRequiredForeign message; in TEST() local
364 EXPECT_TRUE(ReflectionOps::IsInitialized(message)); in TEST()
365 EXPECT_TRUE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
368 message.mutable_optional_message(); in TEST()
369 EXPECT_FALSE(ReflectionOps::IsInitialized(message)); in TEST()
370 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
371 EXPECT_FALSE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
374 message.mutable_optional_message()->set_a(1); in TEST()
375 message.mutable_optional_message()->set_b(2); in TEST()
376 message.mutable_optional_message()->set_c(3); in TEST()
377 EXPECT_TRUE(ReflectionOps::IsInitialized(message)); in TEST()
378 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
379 EXPECT_TRUE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
382 unittest::TestRequired* sub_message = message.add_repeated_message(); in TEST()
383 EXPECT_FALSE(ReflectionOps::IsInitialized(message)); in TEST()
384 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
385 EXPECT_FALSE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
391 EXPECT_TRUE(ReflectionOps::IsInitialized(message)); in TEST()
392 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
393 EXPECT_TRUE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
397 unittest::TestAllExtensions message; in TEST() local
401 EXPECT_TRUE(ReflectionOps::IsInitialized(message)); in TEST()
402 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
403 EXPECT_TRUE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
406 message.MutableExtension(unittest::TestRequired::single); in TEST()
407 EXPECT_FALSE(ReflectionOps::IsInitialized(message)); in TEST()
408 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
409 EXPECT_FALSE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
412 message.MutableExtension(unittest::TestRequired::single)->set_a(1); in TEST()
413 message.MutableExtension(unittest::TestRequired::single)->set_b(2); in TEST()
414 message.MutableExtension(unittest::TestRequired::single)->set_c(3); in TEST()
415 EXPECT_TRUE(ReflectionOps::IsInitialized(message)); in TEST()
416 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
417 EXPECT_TRUE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
420 message.AddExtension(unittest::TestRequired::multi); in TEST()
421 EXPECT_FALSE(ReflectionOps::IsInitialized(message)); in TEST()
422 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
423 EXPECT_FALSE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
426 message.MutableExtension(unittest::TestRequired::multi, 0)->set_a(1); in TEST()
427 message.MutableExtension(unittest::TestRequired::multi, 0)->set_b(2); in TEST()
428 message.MutableExtension(unittest::TestRequired::multi, 0)->set_c(3); in TEST()
429 EXPECT_TRUE(ReflectionOps::IsInitialized(message)); in TEST()
430 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
431 EXPECT_TRUE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
435 unittest::TestRequiredOneof message; in TEST() local
436 EXPECT_TRUE(ReflectionOps::IsInitialized(message)); in TEST()
437 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
438 EXPECT_TRUE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
440 message.mutable_foo_message(); in TEST()
441 EXPECT_FALSE(ReflectionOps::IsInitialized(message)); in TEST()
442 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
443 EXPECT_FALSE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
445 message.set_foo_int(1); in TEST()
446 EXPECT_TRUE(ReflectionOps::IsInitialized(message)); in TEST()
447 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
448 EXPECT_TRUE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
450 message.mutable_foo_message(); in TEST()
451 EXPECT_FALSE(ReflectionOps::IsInitialized(message)); in TEST()
452 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
453 EXPECT_FALSE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
454 message.mutable_foo_message()->set_required_double(0.1); in TEST()
455 EXPECT_TRUE(ReflectionOps::IsInitialized(message)); in TEST()
456 EXPECT_TRUE(ReflectionOps::IsInitialized(message, true, false)); in TEST()
457 EXPECT_TRUE(ReflectionOps::IsInitialized(message, false, true)); in TEST()
460 static std::string FindInitializationErrors(const Message& message) { in FindInitializationErrors() argument
462 ReflectionOps::FindInitializationErrors(message, "", &errors); in FindInitializationErrors()
467 unittest::TestRequired message; in TEST() local
468 EXPECT_EQ("a,b,c", FindInitializationErrors(message)); in TEST()
472 unittest::TestRequiredForeign message; in TEST() local
473 message.mutable_optional_message(); in TEST()
474 message.add_repeated_message(); in TEST()
475 message.add_repeated_message(); in TEST()
486 FindInitializationErrors(message)); in TEST()
490 unittest::TestAllExtensions message; in TEST() local
491 message.MutableExtension(unittest::TestRequired::single); in TEST()
492 message.AddExtension(unittest::TestRequired::multi); in TEST()
493 message.AddExtension(unittest::TestRequired::multi); in TEST()
504 FindInitializationErrors(message)); in TEST()
508 unittest::TestRequiredOneof message; in TEST() local
509 message.mutable_foo_message(); in TEST()
510 EXPECT_EQ("foo_message.required_double", FindInitializationErrors(message)); in TEST()
516 unittest::TestAllTypes message; in TEST() local
521 GenericSwap(&message, arena_message); in TEST()
523 TestUtil::ExpectAllFieldsSet(message); in TEST()
529 unittest::TestAllTypes message; in TEST() local
534 GenericSwap(arena_message, &message); in TEST()
536 TestUtil::ExpectAllFieldsSet(message); in TEST()