Skip to content

Commit 7aedac2

Browse files
committed
vtype: test VEnum index range check
1 parent 2263e18 commit 7aedac2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

epics-vtype/vtype/src/test/java/org/epics/vtype/VEnumTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ public void of4() {
4444
VEnum value = VEnum.of(0, EnumDisplay.of(3), Alarm.none(), null);
4545
}
4646

47+
@Test(expected = IndexOutOfBoundsException.class)
48+
public void of5() {
49+
VEnum value = VEnum.of(-1, EnumDisplay.of(3), Alarm.none(), Time.now());
50+
}
51+
52+
@Test(expected = IndexOutOfBoundsException.class)
53+
public void of6() {
54+
VEnum value = VEnum.of(3, EnumDisplay.of(3), Alarm.none(), Time.now());
55+
}
56+
4757
@Test
4858
public void equals1() {
4959
EnumDisplay display = EnumDisplay.of("A", "B", "C");

0 commit comments

Comments
 (0)