Lines Matching full:any
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
73 google::protobuf::Any any; in TEST() local
74 any.PackFrom(payload); in TEST()
78 EXPECT_FALSE(any.UnpackTo(&dest)); in TEST()
82 // We can pack a Any message inside another Any message. in TEST()
85 google::protobuf::Any any; in TEST() local
86 any.PackFrom(submessage); in TEST()
88 message.mutable_any_value()->PackFrom(any); in TEST()
94 any.Clear(); in TEST()
96 ASSERT_TRUE(message.any_value().UnpackTo(&any)); in TEST()
97 ASSERT_TRUE(any.UnpackTo(&submessage)); in TEST()
104 google::protobuf::Any any; in TEST() local
106 any.PackFrom(submessage, "type.myservice.com"); in TEST()
107 EXPECT_EQ("type.myservice.com/protobuf_unittest.TestAny", any.type_url()); in TEST()
109 any.PackFrom(submessage, "type.myservice.com/"); in TEST()
110 EXPECT_EQ("type.myservice.com/protobuf_unittest.TestAny", any.type_url()); in TEST()
112 any.PackFrom(submessage, ""); in TEST()
113 EXPECT_EQ("/protobuf_unittest.TestAny", any.type_url()); in TEST()
117 EXPECT_TRUE(any.UnpackTo(&submessage)); in TEST()
124 google::protobuf::Any any; in TEST() local
125 any.PackFrom(submessage); in TEST()
126 ASSERT_TRUE(any.ParseFromString(any.SerializeAsString())); in TEST()
127 EXPECT_TRUE(any.Is<protobuf_unittest::TestAny>()); in TEST()
128 EXPECT_FALSE(any.Is<google::protobuf::Any>()); in TEST()
131 message.mutable_any_value()->PackFrom(any); in TEST()
134 EXPECT_TRUE(message.any_value().Is<google::protobuf::Any>()); in TEST()
136 any.set_type_url("/protobuf_unittest.TestAny"); in TEST()
137 EXPECT_TRUE(any.Is<protobuf_unittest::TestAny>()); in TEST()
139 any.set_type_url("protobuf_unittest.TestAny"); in TEST()
140 EXPECT_FALSE(any.Is<protobuf_unittest::TestAny>()); in TEST()
142 any.set_type_url("/TestAny"); in TEST()
143 EXPECT_FALSE(any.Is<protobuf_unittest::TestAny>()); in TEST()
150 google::protobuf::Any src; in TEST()
155 google::protobuf::Any dst(std::move(src)); in TEST()
166 google::protobuf::Any src; in TEST()
171 google::protobuf::Any dst; in TEST()
182 google::protobuf::Any any; in TEST() local
183 EXPECT_DEATH(any.PackFrom(any), "&message"); in TEST()
184 EXPECT_DEATH(any.PackFrom(any, ""), "&message"); in TEST()