diff options
author | Jose <jose@zeroc.com> | 2020-04-23 19:23:00 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2020-04-23 19:23:00 +0200 |
commit | be735ae610d43ec4feab7f70c748a98b945efbe0 (patch) | |
tree | 7f3e541d39283c75590c9f5cb275cbc98548139a /java | |
parent | NuGet package build fixes (diff) | |
download | ice-be735ae610d43ec4feab7f70c748a98b945efbe0.tar.bz2 ice-be735ae610d43ec4feab7f70c748a98b945efbe0.tar.xz ice-be735ae610d43ec4feab7f70c748a98b945efbe0.zip |
Bug in optional test for tagged sequences - Close #803
Diffstat (limited to 'java')
-rw-r--r-- | java/test/src/main/java/test/Ice/optional/AllTests.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/java/test/src/main/java/test/Ice/optional/AllTests.java b/java/test/src/main/java/test/Ice/optional/AllTests.java index 56aba5aeab3..1b15928b90d 100644 --- a/java/test/src/main/java/test/Ice/optional/AllTests.java +++ b/java/test/src/main/java/test/Ice/optional/AllTests.java @@ -1563,7 +1563,6 @@ public class AllTests os = new OutputStream(communicator); os.startEncapsulation(); os.writeOptional(2, OptionalFormat.VSize); - os.writeSize(p1.get().length + (p1.get().length > 254 ? 5 : 1)); SmallStructSeqHelper.write(os, p1.get()); os.endEncapsulation(); inEncaps = os.finished(); @@ -1571,14 +1570,12 @@ public class AllTests in = new InputStream(communicator, inv.outParams); in.startEncapsulation(); test(in.readOptional(1, OptionalFormat.VSize)); - in.skipSize(); SmallStruct[] arr = SmallStructSeqHelper.read(in); for(int i = 0; i < p1.get().length; ++i) { test(arr[i].equals(p1.get()[i])); } test(in.readOptional(3, OptionalFormat.VSize)); - in.skipSize(); arr = SmallStructSeqHelper.read(in); for(int i = 0; i < p1.get().length; ++i) { @@ -1586,6 +1583,10 @@ public class AllTests } in.endEncapsulation(); + // Check the outEncaps size matches the expected size, 6 bytes for the encapsulation, plus 12 bytes + // for each sequence (1 byte tag, 1 byte size, 10 byte contents) + test(inv.outParams.length == 12 + 12 + 6); + in = new InputStream(communicator, inv.outParams); in.startEncapsulation(); in.endEncapsulation(); |