Home
last modified time | relevance | path

Searched refs:TestAllTypes (Results 1 – 25 of 126) sorted by relevance

123456

/external/protobuf/java/core/src/test/java/com/google/protobuf/
DFieldPresenceTest.java35 import com.google.protobuf.FieldPresenceTestProto.TestAllTypes;
72 UnittestProto.TestAllTypes.class, in testHasMethod()
73 TestAllTypes.class, in testHasMethod()
76 UnittestProto.TestAllTypes.class, in testHasMethod()
77 TestAllTypes.class, in testHasMethod()
80 UnittestProto.TestAllTypes.class, in testHasMethod()
81 TestAllTypes.class, in testHasMethod()
84 UnittestProto.TestAllTypes.class, in testHasMethod()
85 TestAllTypes.class, in testHasMethod()
89 UnittestProto.TestAllTypes.Builder.class, in testHasMethod()
[all …]
DSingleFieldBuilderTest.java33 import protobuf_unittest.UnittestProto.TestAllTypes;
49 SingleFieldBuilder<TestAllTypes, TestAllTypes.Builder, in testBasicUseAndInvalidations()
51 new SingleFieldBuilder<TestAllTypes, TestAllTypes.Builder, in testBasicUseAndInvalidations()
53 TestAllTypes.getDefaultInstance(), in testBasicUseAndInvalidations()
56 assertSame(TestAllTypes.getDefaultInstance(), builder.getMessage()); in testBasicUseAndInvalidations()
57 assertEquals(TestAllTypes.getDefaultInstance(), in testBasicUseAndInvalidations()
63 TestAllTypes message = builder.build(); in testBasicUseAndInvalidations()
79 SingleFieldBuilder<TestAllTypes, TestAllTypes.Builder, in testSetMessage()
81 new SingleFieldBuilder<TestAllTypes, TestAllTypes.Builder, in testSetMessage()
83 TestAllTypes.getDefaultInstance(), in testSetMessage()
[all …]
DAnyTest.java34 import protobuf_unittest.UnittestProto.TestAllTypes;
43 TestAllTypes.Builder builder = TestAllTypes.newBuilder(); in testAnyGeneratedApi()
45 TestAllTypes message = builder.build(); in testAnyGeneratedApi()
50 assertTrue(container.getValue().is(TestAllTypes.class)); in testAnyGeneratedApi()
53 TestAllTypes result = container.getValue().unpack(TestAllTypes.class); in testAnyGeneratedApi()
71 TestAllTypes parsingFailed = container.getValue().unpack(TestAllTypes.class); in testAnyGeneratedApi()
79 TestAllTypes.Builder builder = TestAllTypes.newBuilder(); in testCustomTypeUrls()
81 TestAllTypes message = builder.build(); in testCustomTypeUrls()
87 "xxx.com/" + TestAllTypes.getDescriptor().getFullName(), in testCustomTypeUrls()
90 assertTrue(container.getValue().is(TestAllTypes.class)); in testCustomTypeUrls()
[all …]
DUnknownEnumValueTest.java37 import com.google.protobuf.FieldPresenceTestProto.TestAllTypes;
48 TestAllTypes.Builder builder = TestAllTypes.newBuilder(); in testUnknownEnumValues()
52 TestAllTypes message = builder.build(); in testUnknownEnumValues()
58 assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, message.getOptionalNestedEnum()); in testUnknownEnumValues()
59 assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, message.getRepeatedNestedEnum(0)); in testUnknownEnumValues()
60 assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, message.getRepeatedNestedEnumList().get(0)); in testUnknownEnumValues()
61 assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, message.getPackedNestedEnum(0)); in testUnknownEnumValues()
65 message = TestAllTypes.parseFrom(data); in testUnknownEnumValues()
71 assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, message.getOptionalNestedEnum()); in testUnknownEnumValues()
72 assertEquals(TestAllTypes.NestedEnum.UNRECOGNIZED, message.getRepeatedNestedEnum(0)); in testUnknownEnumValues()
[all …]
DRepeatedFieldBuilderTest.java33 import protobuf_unittest.UnittestProto.TestAllTypes;
52 RepeatedFieldBuilder<TestAllTypes, TestAllTypes.Builder, in testBasicUse()
54 builder.addMessage(TestAllTypes.newBuilder().setOptionalInt32(0).build()); in testBasicUse()
55 builder.addMessage(TestAllTypes.newBuilder().setOptionalInt32(1).build()); in testBasicUse()
59 List<TestAllTypes> list = builder.build(); in testBasicUse()
66 List<TestAllTypes> list2 = builder.build(); in testBasicUse()
73 RepeatedFieldBuilder<TestAllTypes, TestAllTypes.Builder, in testGoingBackAndForth()
75 builder.addMessage(TestAllTypes.newBuilder().setOptionalInt32(0).build()); in testGoingBackAndForth()
76 builder.addMessage(TestAllTypes.newBuilder().setOptionalInt32(1).build()); in testGoingBackAndForth()
81 List<TestAllTypes> list = builder.build(); in testGoingBackAndForth()
[all …]
DGeneratedMessageTest.java61 import protobuf_unittest.UnittestProto.TestAllTypes;
62 import protobuf_unittest.UnittestProto.TestAllTypes.NestedMessage;
88 new TestUtil.ReflectionTester(TestAllTypes.getDescriptor(), null);
91 assertSame(TestAllTypes.getDefaultInstance(), in testDefaultInstance()
92 TestAllTypes.getDefaultInstance().getDefaultInstanceForType()); in testDefaultInstance()
93 assertSame(TestAllTypes.getDefaultInstance(), in testDefaultInstance()
94 TestAllTypes.newBuilder().getDefaultInstanceForType()); in testDefaultInstance()
98 TestAllTypes.Builder builder = TestAllTypes.newBuilder(); in testMessageOrBuilder()
100 TestAllTypes message = builder.build(); in testMessageOrBuilder()
105 TestAllTypes.Builder builder = TestAllTypes.newBuilder(); in testUsingBuilderMultipleTimes()
[all …]
DTextFormatTest.java40 import protobuf_unittest.UnittestProto.TestAllTypes;
41 import protobuf_unittest.UnittestProto.TestAllTypes.NestedMessage;
235 TestAllTypes.getDescriptor().findFieldByName("optional_nested_message"); in testPrintField()
266 Message message = TestAllTypes.newBuilder() in testPrintExotic()
321 TestAllTypes.Builder builder = TestAllTypes.newBuilder(); in testParse()
327 TestAllTypes.Builder builder = TestAllTypes.newBuilder(); in testParseReader()
365 TestAllTypes.Builder builder = TestAllTypes.newBuilder(); in testParseCompatibility()
371 TestAllTypes.Builder builder = TestAllTypes.newBuilder(); in testParseExotic()
433 TestAllTypes.Builder builder = TestAllTypes.newBuilder(); in testParseNumericEnum()
435 assertEquals(TestAllTypes.NestedEnum.BAR, builder.getOptionalNestedEnum()); in testParseNumericEnum()
[all …]
DLazyFieldLiteTest.java37 import protobuf_unittest.UnittestProto.TestAllTypes;
53 assertEquals(message, lazyField.getValue(TestAllTypes.getDefaultInstance())); in testGetValue()
55 assertNotEqual(message, lazyField.getValue(TestAllTypes.getDefaultInstance())); in testGetValue()
70 assertNotEqual(message, lazyField.getValue(TestAllTypes.getDefaultInstance())); in testSetValue()
71 message = lazyField.getValue(TestAllTypes.getDefaultInstance()); in testSetValue()
73 assertEquals(message, lazyField.getValue(TestAllTypes.getDefaultInstance())); in testSetValue()
139 TestAllTypes.getDefaultInstance(), field.getValue(TestAllTypes.getDefaultInstance())); in testInvalidProto()
145 TestAllTypes message1 = TestAllTypes.newBuilder().setOptionalInt32(1).build(); in testMergeBeforeParsing()
147 TestAllTypes message2 = TestAllTypes.newBuilder().setOptionalInt64(2).build(); in testMergeBeforeParsing()
151 TestAllTypes expected = in testMergeBeforeParsing()
[all …]
DUnknownFieldSetTest.java36 import protobuf_unittest.UnittestProto.TestAllTypes;
55 descriptor = TestAllTypes.getDescriptor(); in setUp()
94 TestAllTypes allFields;
134 TestAllTypes.OptionalGroup.getDescriptor().findFieldByName("a"); in testGroup()
229 TestAllTypes destination = TestAllTypes.parseFrom(data); in testParseKnownAndUnknown()
245 TestAllTypes allTypesMessage = TestAllTypes.parseFrom(bizarroData); in testWrongTypeTreatedAsUnknown()
282 TestAllTypes.getDescriptor().findFieldByName("optional_nested_enum"); in testParseUnknownEnumValue()
284 TestAllTypes.getDescriptor().findFieldByName("repeated_nested_enum"); in testParseUnknownEnumValue()
292 .addVarint(TestAllTypes.NestedEnum.BAR.getNumber()) in testParseUnknownEnumValue()
297 .addVarint(TestAllTypes.NestedEnum.FOO.getNumber()) in testParseUnknownEnumValue()
[all …]
DDynamicMessageTest.java37 import protobuf_unittest.UnittestProto.TestAllTypes;
53 new TestUtil.ReflectionTester(TestAllTypes.getDescriptor(), null);
63 DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); in testDynamicMessageAccessors()
71 DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); in testSettersAfterBuild()
111 DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); in testDynamicMessageSettersRejectNull()
134 DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); in testDynamicMessageRepeatedSetters()
143 DynamicMessage.newBuilder(TestAllTypes.getDescriptor()); in testDynamicMessageRepeatedSettersRejectNull()
149 DynamicMessage.getDefaultInstance(TestAllTypes.getDescriptor())); in testDynamicMessageDefaults()
151 DynamicMessage.newBuilder(TestAllTypes.getDescriptor()).build()); in testDynamicMessageDefaults()
155 TestAllTypes message = TestUtil.getAllSet(); in testDynamicMessageSerializedSize()
[all …]
/external/protobuf/csharp/src/Google.Protobuf.Test/Reflection/
DFieldAccessTest.cs47 var fields = TestAllTypes.Descriptor.Fields; in GetValue()
48 …Assert.AreEqual(message.SingleBool, fields[TestAllTypes.SingleBoolFieldNumber].Accessor.GetValue(m… in GetValue()
49 …Assert.AreEqual(message.SingleBytes, fields[TestAllTypes.SingleBytesFieldNumber].Accessor.GetValue… in GetValue()
50 …Assert.AreEqual(message.SingleDouble, fields[TestAllTypes.SingleDoubleFieldNumber].Accessor.GetVal… in GetValue()
51 …Assert.AreEqual(message.SingleFixed32, fields[TestAllTypes.SingleFixed32FieldNumber].Accessor.GetV… in GetValue()
52 …Assert.AreEqual(message.SingleFixed64, fields[TestAllTypes.SingleFixed64FieldNumber].Accessor.GetV… in GetValue()
53 …Assert.AreEqual(message.SingleFloat, fields[TestAllTypes.SingleFloatFieldNumber].Accessor.GetValue… in GetValue()
54 …Assert.AreEqual(message.SingleForeignEnum, fields[TestAllTypes.SingleForeignEnumFieldNumber].Acces… in GetValue()
55 …Assert.AreEqual(message.SingleForeignMessage, fields[TestAllTypes.SingleForeignMessageFieldNumber]… in GetValue()
56 …Assert.AreEqual(message.SingleImportEnum, fields[TestAllTypes.SingleImportEnumFieldNumber].Accesso… in GetValue()
[all …]
/external/protobuf/src/google/protobuf/
Darena_unittest.cc65 using protobuf_unittest::TestAllTypes;
158 EXPECT_TRUE(Arena::is_arena_constructable<TestAllTypes>::type::value); in TEST()
159 EXPECT_TRUE(Arena::is_arena_constructable<const TestAllTypes>::type::value); in TEST()
246 TestAllTypes original; in TEST()
251 TestAllTypes* arena_message = Arena::CreateMessage<TestAllTypes>(&arena); in TEST()
261 TestAllTypes original; in TEST()
271 TestAllTypes copied; in TEST()
278 TestAllTypes::kOptionalInt32FieldNumber, 42); in TEST()
309 TestAllTypes* arena1_message; in TEST()
310 TestAllTypes* arena2_message; in TEST()
[all …]
Dproto3_arena_unittest.cc46 using proto3_arena_unittest::TestAllTypes;
52 void SetAllFields(TestAllTypes* m) { in SetAllFields()
79 void ExpectAllFieldsSet(const TestAllTypes& m) { in ExpectAllFieldsSet()
113 EXPECT_EQ(proto3_arena_unittest::TestAllTypes::kOneofString, in ExpectAllFieldsSet()
123 TestAllTypes original; in TEST()
127 TestAllTypes* arena_message = Arena::CreateMessage<TestAllTypes>(&arena); in TEST()
133 TestAllTypes original; in TEST()
137 TestAllTypes* arena_message = Arena::CreateMessage<TestAllTypes>(&arena); in TEST()
158 TestAllTypes* arena1_message = Arena::CreateMessage<TestAllTypes>(&arena1); in TEST()
159 TestAllTypes* arena2_message = Arena::CreateMessage<TestAllTypes>(&arena2); in TEST()
[all …]
Dproto3_arena_lite_unittest.cc46 using proto3_arena_lite_unittest::TestAllTypes;
52 void SetAllFields(TestAllTypes* m) { in SetAllFields()
79 void ExpectAllFieldsSet(const TestAllTypes& m) { in ExpectAllFieldsSet()
113 EXPECT_EQ(proto3_arena_lite_unittest::TestAllTypes::kOneofString, in ExpectAllFieldsSet()
123 TestAllTypes original; in TEST()
127 TestAllTypes* arena_message = Arena::CreateMessage<TestAllTypes>(&arena); in TEST()
137 TestAllTypes* arena1_message = Arena::CreateMessage<TestAllTypes>(&arena1); in TEST()
138 TestAllTypes* arena2_message = Arena::CreateMessage<TestAllTypes>(&arena2); in TEST()
146 TestAllTypes *arena_message = Arena::CreateMessage<TestAllTypes>(&arena); in TEST()
147 TestAllTypes::NestedMessage* nested = new TestAllTypes::NestedMessage; in TEST()
[all …]
Drepeated_field_reflection_unittest.cc48 using unittest::TestAllTypes;
64 TestAllTypes message; in TEST()
156 EXPECT_DEATH(refl->GetRepeatedPtrField<TestAllTypes>( in TEST()
206 TestAllTypes message; in TEST()
316 &TestAllTypes::repeated_int32); in TEST()
318 &TestAllTypes::repeated_double); in TEST()
320 &TestAllTypes::repeated_string); in TEST()
421 EXPECT_DEATH(refl->GetRepeatedFieldRef<TestAllTypes>( in TEST()
428 TestAllTypes message; in TEST()
433 message.add_repeated_nested_enum(TestAllTypes::BAR); in TEST()
[all …]
Dmessage_unittest.cc77 protobuf_unittest::TestAllTypes message; in TEST()
104 protobuf_unittest::TestAllTypes message; in TEST()
115 unittest::TestAllTypes message; in TEST()
142 protobuf_unittest::TestAllTypes message; in TEST()
149 protobuf_unittest::TestAllTypes message; in TEST()
156 protobuf_unittest::TestAllTypes message; in TEST()
168 protobuf_unittest::TestAllTypes message; in TEST()
177 protobuf_unittest::TestAllTypes message; in TEST()
212 unittest::TestAllTypes test_all_types; in TEST()
216 google::protobuf::internal::DynamicCastToGenerated<unittest::TestAllTypes>( in TEST()
[all …]
Dtest_util.h52 static void SetAllFields(unittest::TestAllTypes* message);
53 static void SetOptionalFields(unittest::TestAllTypes* message);
54 static void AddRepeatedFields1(unittest::TestAllTypes* message);
55 static void AddRepeatedFields2(unittest::TestAllTypes* message);
56 static void SetDefaultFields(unittest::TestAllTypes* message);
57 static void SetOneofFields(unittest::TestAllTypes* message);
71 static void ModifyRepeatedFields(unittest::TestAllTypes* message);
78 static void ExpectAllFieldsSet(const unittest::TestAllTypes& message);
94 const unittest::TestAllTypes& message);
103 static void ExpectClear(const unittest::TestAllTypes& message);
[all …]
/external/golang-protobuf/_conformance/conformance_proto/
Dconformance.pb.go468 type TestAllTypes struct { struct
491 …RecursiveMessage *TestAllTypes `protobuf:"bytes,27,opt,name=recursive_message,… argument
598 func (m *TestAllTypes) Reset() { *m = TestAllTypes{} } argument
599 func (m *TestAllTypes) String() string { return proto.CompactTextString(m) } argument
600 func (*TestAllTypes) ProtoMessage() {} argument
601 func (*TestAllTypes) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } argument
645 func (m *TestAllTypes) GetOneofField() isTestAllTypes_OneofField { argument
652 func (m *TestAllTypes) GetOptionalInt32() int32 { argument
659 func (m *TestAllTypes) GetOptionalInt64() int64 { argument
666 func (m *TestAllTypes) GetOptionalUint32() uint32 { argument
[all …]
/external/protobuf/csharp/src/Google.Protobuf.Test/
DGeneratedMessageTest.cs53 var message1 = new TestAllTypes { SingleForeignMessage = new ForeignMessage() }; in EmptyMessageFieldDistinctFromMissingMessageField()
54 var message2 = new TestAllTypes(); // SingleForeignMessage is null in EmptyMessageFieldDistinctFromMissingMessageField()
62 var message = new TestAllTypes(); in DefaultValues()
75 Assert.AreEqual(TestAllTypes.Types.NestedEnum.Unspecified, message.SingleNestedEnum); in DefaultValues()
109 Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); in DefaultValues()
119 var message = new TestAllTypes(); in NullStringAndBytesRejected()
129 var message = new TestAllTypes(); in RoundTrip_Empty()
133 TestAllTypes parsed = TestAllTypes.Parser.ParseFrom(bytes); in RoundTrip_Empty()
140 var message = new TestAllTypes in RoundTrip_SingleValues()
154 SingleNestedEnum = TestAllTypes.Types.NestedEnum.Foo, in RoundTrip_SingleValues()
[all …]
DJsonParserTest.cs78 var expected = new TestAllTypes { SingleInt32 = 10 }; in OriginalFieldNameAccepted()
79 Assert.AreEqual(expected, TestAllTypes.Parser.ParseJson(json)); in OriginalFieldNameAccepted()
195 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in RepeatedField_NullElementProhibited()
202 Assert.AreEqual(new TestAllTypes(), TestAllTypes.Parser.ParseJson(json)); in RepeatedField_NullOverallValueAllowed()
248 var parsed = TestAllTypes.Parser.ParseJson(json); in StringToInt32_Valid()
267 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in StringToInt32_Invalid()
277 var parsed = TestAllTypes.Parser.ParseJson(json); in StringToUInt32_Valid()
288 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in StringToUInt32_Invalid()
300 var parsed = TestAllTypes.Parser.ParseJson(json); in StringToInt64_Valid()
311 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in StringToInt64_Invalid()
[all …]
/external/protobuf/python/google/protobuf/internal/
Dgenerator_test.py67 proto_type = unittest_pb2.TestAllTypes
80 proto = unittest_pb2.TestAllTypes()
82 self.assertEqual(1, unittest_pb2.TestAllTypes.FOO)
84 self.assertEqual(2, unittest_pb2.TestAllTypes.BAR)
86 self.assertEqual(3, unittest_pb2.TestAllTypes.BAZ)
114 desc = unittest_pb2.TestAllTypes.DESCRIPTOR
162 set(unittest_pb2.TestAllTypes.DESCRIPTOR.nested_types),
164 unittest_pb2.TestAllTypes.NestedMessage.DESCRIPTOR,
165 unittest_pb2.TestAllTypes.OptionalGroup.DESCRIPTOR,
166 unittest_pb2.TestAllTypes.RepeatedGroup.DESCRIPTOR,
[all …]
Dsymbol_database_test.py55 db.RegisterMessage(unittest_pb2.TestAllTypes)
56 db.RegisterMessage(unittest_pb2.TestAllTypes.NestedMessage)
57 db.RegisterMessage(unittest_pb2.TestAllTypes.OptionalGroup)
58 db.RegisterMessage(unittest_pb2.TestAllTypes.RepeatedGroup)
60 db.RegisterEnumDescriptor(unittest_pb2.TestAllTypes.NestedEnum.DESCRIPTOR)
65 unittest_pb2.TestAllTypes.DESCRIPTOR)
66 self.assertTrue(instance is unittest_pb2.TestAllTypes)
72 unittest_pb2.TestAllTypes is
77 unittest_pb2.TestAllTypes, self._Database().GetSymbol(
80 unittest_pb2.TestAllTypes.NestedMessage, self._Database().GetSymbol(
[all …]
Dreflection_test.py120 proto = unittest_pb2.TestAllTypes(
133 proto = unittest_pb2.TestAllTypes(
148 proto = unittest_pb2.TestAllTypes(
150 unittest_pb2.TestAllTypes.NestedMessage(
151 bb=unittest_pb2.TestAllTypes.FOO),
152 unittest_pb2.TestAllTypes.NestedMessage(
153 bb=unittest_pb2.TestAllTypes.BAR)],
159 unittest_pb2.TestAllTypes.RepeatedGroup(),
160 unittest_pb2.TestAllTypes.RepeatedGroup(a=1),
161 unittest_pb2.TestAllTypes.RepeatedGroup(a=2)])
[all …]
/external/protobuf/java/util/src/test/java/com/google/protobuf/util/
DJsonFormatTest.java50 import com.google.protobuf.util.JsonTestProto.TestAllTypes;
51 import com.google.protobuf.util.JsonTestProto.TestAllTypes.NestedEnum;
52 import com.google.protobuf.util.JsonTestProto.TestAllTypes.NestedMessage;
70 private void setAllFields(TestAllTypes.Builder builder) { in setAllFields()
148 TestAllTypes.Builder builder = TestAllTypes.newBuilder(); in testAllFields()
150 TestAllTypes message = builder.build(); in testAllFields()
201 TestAllTypes message = TestAllTypes.newBuilder() in testUnknownEnumValues()
229 TestAllTypes message = TestAllTypes.newBuilder() in testSpecialFloatValues()
247 TestAllTypes.Builder builder = TestAllTypes.newBuilder(); in testParserAcceptStringForNumbericField()
259 TestAllTypes message = builder.build(); in testParserAcceptStringForNumbericField()
[all …]
/external/protobuf/objectivec/Tests/
DGPBTestUtilities.h34 @class TestAllTypes;
54 - (void)setAllFields:(TestAllTypes *)message repeatedCount:(uint32_t)count;
55 - (void)clearAllFields:(TestAllTypes *)message;
68 - (TestAllTypes *)allSetRepeatedCount:(uint32_t)count;
73 - (void)assertAllFieldsSet:(TestAllTypes *)message
77 - (void)assertRepeatedFieldsModified:(TestAllTypes *)message
82 - (void)assertClear:(TestAllTypes *)message;
89 - (void)modifyRepeatedFields:(TestAllTypes *)message;
95 - (void)assertAllFieldsKVCMatch:(TestAllTypes *)message;
96 - (void)setAllFieldsViaKVC:(TestAllTypes *)message
[all …]

123456