|
|
|
@ -291,16 +291,9 @@ public class CodedOutputStreamTest { |
|
|
|
|
// Streaming's buffering masks out of bounds writes.
|
|
|
|
|
assume().that(outputType).isNotEqualTo(OutputType.STREAM); |
|
|
|
|
|
|
|
|
|
Class<? extends Exception> e = OutOfSpaceException.class; |
|
|
|
|
// UnsafeDirectNioEncoder is incorrectly throwing IndexOutOfBoundsException for some operations.
|
|
|
|
|
if (outputType == OutputType.NIO_DIRECT_UNSAFE |
|
|
|
|
|| outputType == OutputType.NIO_DIRECT_UNSAFE_WITH_INITIAL_OFFSET) { |
|
|
|
|
e = IndexOutOfBoundsException.class; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 4; i++) { |
|
|
|
|
Coder coder = outputType.newCoder(i); |
|
|
|
|
assertThrows(e, () -> coder.stream().writeFixed32NoTag(1)); |
|
|
|
|
assertThrows(OutOfSpaceException.class, () -> coder.stream().writeFixed32NoTag(1)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -309,16 +302,9 @@ public class CodedOutputStreamTest { |
|
|
|
|
// Streaming's buffering masks out of bounds writes.
|
|
|
|
|
assume().that(outputType).isNotEqualTo(OutputType.STREAM); |
|
|
|
|
|
|
|
|
|
Class<? extends Exception> e = OutOfSpaceException.class; |
|
|
|
|
// UnsafeDirectNioEncoder is incorrectly throwing IndexOutOfBoundsException for some operations.
|
|
|
|
|
if (outputType == OutputType.NIO_DIRECT_UNSAFE |
|
|
|
|
|| outputType == OutputType.NIO_DIRECT_UNSAFE_WITH_INITIAL_OFFSET) { |
|
|
|
|
e = IndexOutOfBoundsException.class; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 8; i++) { |
|
|
|
|
Coder coder = outputType.newCoder(i); |
|
|
|
|
assertThrows(e, () -> coder.stream().writeFixed64NoTag(1)); |
|
|
|
|
assertThrows(OutOfSpaceException.class, () -> coder.stream().writeFixed64NoTag(1)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|