diff options
author | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2009-08-07 21:02:02 +0000 |
---|---|---|
committer | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2009-08-07 21:02:02 +0000 |
commit | 68996fc874300337ec7349f50d0b1cbb3a6f1bec (patch) | |
tree | fd0f9a7b63b00dc0bc2898e6d44913dd95150423 /java/src/test | |
parent | 445f1023e1159212c65cb6c27c4f0a3121248a79 (diff) | |
download | protobuf-68996fc874300337ec7349f50d0b1cbb3a6f1bec.tar.gz protobuf-68996fc874300337ec7349f50d0b1cbb3a6f1bec.tar.bz2 protobuf-68996fc874300337ec7349f50d0b1cbb3a6f1bec.zip |
Gigantic descriptors shouldn't overflow the Java string literal size limit.
Diffstat (limited to 'java/src/test')
-rw-r--r-- | java/src/test/java/com/google/protobuf/DescriptorsTest.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/java/src/test/java/com/google/protobuf/DescriptorsTest.java b/java/src/test/java/com/google/protobuf/DescriptorsTest.java index 6fa56267..c5c38b27 100644 --- a/java/src/test/java/com/google/protobuf/DescriptorsTest.java +++ b/java/src/test/java/com/google/protobuf/DescriptorsTest.java @@ -397,4 +397,12 @@ public class DescriptorsTest extends TestCase { assertEquals(values1[i].toString(), values2[i].toString()); } } + + public void testEnormousDescriptor() throws Exception { + // The descriptor for this file is larger than 64k, yet it did not cause + // a compiler error due to an over-long string literal. + assertTrue( + UnittestEnormousDescriptor.getDescriptor() + .toProto().getSerializedSize() > 65536); + } } |