diff options
Diffstat (limited to 'javanano')
-rw-r--r-- | javanano/pom.xml | 9 | ||||
-rw-r--r-- | javanano/src/test/java/com/google/protobuf/nano/NanoTest.java | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/javanano/pom.xml b/javanano/pom.xml index 7a2be9df..64ed4372 100644 --- a/javanano/pom.xml +++ b/javanano/pom.xml @@ -139,6 +139,15 @@ <arg value="--proto_path=src/test/java/com" /> <arg value="src/test/java/com/google/protobuf/nano/unittest_reference_types_nano.proto" /> </exec> + <exec executable="../src/protoc"> + <arg value="--javanano_out= + optional_field_style=reftypes_compat_mode, + generate_equals=true, + java_outer_classname=google/protobuf/nano/unittest_reference_types_nano.proto|NanoReferenceTypesCompat + :target/generated-test-sources" /> + <arg value="--proto_path=src/test/java/com" /> + <arg value="src/test/java/com/google/protobuf/nano/unittest_reference_types_nano.proto" /> + </exec> </tasks> <testSourceRoot>target/generated-test-sources</testSourceRoot> </configuration> diff --git a/javanano/src/test/java/com/google/protobuf/nano/NanoTest.java b/javanano/src/test/java/com/google/protobuf/nano/NanoTest.java index d60e94ff..c81846e5 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/NanoTest.java +++ b/javanano/src/test/java/com/google/protobuf/nano/NanoTest.java @@ -36,6 +36,7 @@ import com.google.protobuf.nano.NanoAccessorsOuterClass.TestNanoAccessors; import com.google.protobuf.nano.NanoHasOuterClass.TestAllTypesNanoHas; import com.google.protobuf.nano.NanoOuterClass.TestAllTypesNano; import com.google.protobuf.nano.UnittestRecursiveNano.RecursiveMessageNano; +import com.google.protobuf.nano.NanoReferenceTypesCompat; import com.google.protobuf.nano.UnittestSimpleNano.SimpleMessageNano; import com.google.protobuf.nano.UnittestSingleNano.SingleMessageNano; import com.google.protobuf.nano.testext.Extensions; @@ -4381,6 +4382,11 @@ public class NanoTest extends TestCase { assertMapSet(testMap.sfixed64ToSfixed64Field, int64Values, int64Values); } + public void testRepeatedFieldInitializedInReftypesCompatMode() { + NanoReferenceTypesCompat.TestAllTypesNano proto = new NanoReferenceTypesCompat.TestAllTypesNano(); + assertNotNull(proto.repeatedString); + } + private void assertRepeatedPackablesEqual( NanoRepeatedPackables.NonPacked nonPacked, NanoRepeatedPackables.Packed packed) { // Not using MessageNano.equals() -- that belongs to a separate test. |