Skip to content

Commit

Permalink
Adds a failing test.
Browse files Browse the repository at this point in the history
Relates jpos#315
  • Loading branch information
christopher-grech committed Jun 12, 2020
1 parent 8af204f commit 2e1f134
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,17 @@ public void testZeroLength() throws ISOException {
byte[] b = p.pack(m, true, 1, 1);
assertArrayEquals(b, ISOUtil.hex2byte("394630323030"));
}

@Test
public void testUnpackingZeroLength() {
try {
BERTLVPackager p = new BERTLVBinaryPackager();
p.setFieldPackager(new ISOFieldPackager[]{new IFA_TTLLBINARY()});

ISOMsg m = new ISOMsg(55);
p.unpack(m, ISOUtil.hex2byte("9F3400"));
} catch (ISOException e) {
fail("Unexpected java.lang.ArithmeticException: divide by zero", e);
}
}
}

0 comments on commit 2e1f134

Please sign in to comment.