Skip to content

Commit 8dd2a22

Browse files
committed
expanding vtable unit tests
1 parent 2d3e9f1 commit 8dd2a22

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212

1313
public class VTableTest {
1414

15+
/**
16+
* ignore the types and labels when determining the column count
17+
*/
1518
@Test
16-
public void testIVTable() {
19+
public void testIVTableColumnCount() {
1720
VTable vTable = new IVTable(Arrays.asList(VInt.class, VDouble.class),
1821
Arrays.asList("int"),
1922
Arrays.asList(ArrayInteger.of(1, 2, 3), ArrayDouble.of(1.0, 2.0, 3.0), ArrayFloat.of(1.0f, 2.0f, 3.0f)));
@@ -26,4 +29,16 @@ public void testIVTable() {
2629
assertTrue(vTable.getColumnType(1).isAssignableFrom(VDouble.class));
2730
assertEquals("int", vTable.getColumnName(0));
2831
}
32+
33+
/**
34+
* NTTables support columns with different row counts, the table should return the max number of rows
35+
*/
36+
@Test
37+
public void testIVTableRowCount() {
38+
VTable vTable = new IVTable(Arrays.asList(),
39+
Arrays.asList("int"),
40+
Arrays.asList(ArrayInteger.of(1, 2, 3), ArrayDouble.of(1.0, 2.0), ArrayFloat.of(1.0f)));
41+
42+
assertEquals(3, vTable.getRowCount());
43+
}
2944
}

0 commit comments

Comments
 (0)