@Test public void index_find_2() { int[] keys = {1, 2, 3, 4, 5, 6, 7, 8, 9}; Index index = test(keys); Record r = intToRecord(20, RecordLib.TestRecordLength); r = index.find(r); assertNull(r); }
@Test public void index_find_1() { int[] keys = {1}; Index index = test(keys); Record r = intToRecord(1, RecordLib.TestRecordLength); r = index.find(r); assertNotNull(r); }
private Index test(int[] insKeys, int[] delKeys, int[] expected) { index = makeIndex(4, 0); testInsert(index, insKeys); long x = index.size(); if (x >= 0) assertEquals(insKeys.length, x); if (delKeys != null) { testDelete(index, delKeys); } if (expected != null) testIndexContents(index, expected); return index; }
@After public void afterTest() { if (index != null) index.close(); index = null; }