Fixed #1769 Missing some body trait variable declaration

This commit is contained in:
Jindra Petřík
2022-11-23 23:42:45 +01:00
parent 3ff9a042c8
commit 25bc05012f
23 changed files with 407 additions and 114 deletions

View File

@@ -65,12 +65,10 @@ public class ABCStreamTest {
@Test
public void testU30() {
for (long number : getTestNumbers(0, (1L << 30) - 1)) {
try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
ABCOutputStream aos = new ABCOutputStream(baos);) {
try ( ByteArrayOutputStream baos = new ByteArrayOutputStream(); ABCOutputStream aos = new ABCOutputStream(baos);) {
aos.writeU30(number);
aos.close();
try (MemoryInputStream mis = new MemoryInputStream(baos.toByteArray());
ABCInputStream ais = new ABCInputStream(mis);) {
try ( MemoryInputStream mis = new MemoryInputStream(baos.toByteArray()); ABCInputStream ais = new ABCInputStream(mis);) {
assertEquals(number, ais.readU30("test"));
assertEquals(0, mis.available());
}
@@ -83,12 +81,10 @@ public class ABCStreamTest {
@Test
public void testU32() {
for (long number : getTestNumbers(0, (1L << 32) - 1)) {
try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
ABCOutputStream aos = new ABCOutputStream(baos);) {
try ( ByteArrayOutputStream baos = new ByteArrayOutputStream(); ABCOutputStream aos = new ABCOutputStream(baos);) {
aos.writeU32(number);
aos.close();
try (MemoryInputStream mis = new MemoryInputStream(baos.toByteArray());
ABCInputStream ais = new ABCInputStream(mis);) {
try ( MemoryInputStream mis = new MemoryInputStream(baos.toByteArray()); ABCInputStream ais = new ABCInputStream(mis);) {
assertEquals(number, ais.readU32("test"));
assertEquals(0, mis.available());
}
@@ -101,12 +97,10 @@ public class ABCStreamTest {
@Test
public void testS32() {
for (long number : getTestNumbers(-(1L << 31), (1 << 31) - 1)) {
try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
ABCOutputStream aos = new ABCOutputStream(baos);) {
try ( ByteArrayOutputStream baos = new ByteArrayOutputStream(); ABCOutputStream aos = new ABCOutputStream(baos);) {
aos.writeS32(number);
aos.close();
try (MemoryInputStream mis = new MemoryInputStream(baos.toByteArray());
ABCInputStream ais = new ABCInputStream(mis);) {
try ( MemoryInputStream mis = new MemoryInputStream(baos.toByteArray()); ABCInputStream ais = new ABCInputStream(mis);) {
assertEquals(number, ais.readS32("test"));
assertEquals(0, mis.available());
}