示例#1
0
  @Test
  public void test_next_dir_infinity() {

    BTreeMap.DirNode d =
        new BTreeMap.DirNode(
            new Object[] {62, 68, 71}, true, false, false, mkchild(10, 20, 30, 40));
    assertEquals(10, m.nextDir(d, 33));
    assertEquals(10, m.nextDir(d, 62));
    assertEquals(20, m.nextDir(d, 63));

    d = new BTreeMap.DirNode(new Object[] {44, 62, 68}, false, true, false, mkchild(10, 20, 30, 0));

    assertEquals(10, m.nextDir(d, 62));
    assertEquals(10, m.nextDir(d, 44));
    assertEquals(10, m.nextDir(d, 48));

    assertEquals(20, m.nextDir(d, 63));
    assertEquals(20, m.nextDir(d, 64));
    assertEquals(20, m.nextDir(d, 68));

    assertEquals(30, m.nextDir(d, 69));
    assertEquals(30, m.nextDir(d, 70));
    assertEquals(30, m.nextDir(d, 71));

    assertEquals(30, m.nextDir(d, 72));
    assertEquals(30, m.nextDir(d, 73));
  }
示例#2
0
  @Test
  public void test_next_dir_infinity() {
    BTreeMap m = new BTreeMap(engine, 32, true, false, null, null, null, null);
    BTreeMap.DirNode d =
        new BTreeMap.DirNode(new Object[] {null, 62, 68, 71}, new long[] {10, 20, 30, 40});
    assertEquals(10, m.nextDir(d, 33));
    assertEquals(10, m.nextDir(d, 62));
    assertEquals(20, m.nextDir(d, 63));

    d = new BTreeMap.DirNode(new Object[] {44, 62, 68, null}, new long[] {10, 20, 30, 40});

    assertEquals(10, m.nextDir(d, 62));
    assertEquals(10, m.nextDir(d, 44));
    assertEquals(10, m.nextDir(d, 48));

    assertEquals(20, m.nextDir(d, 63));
    assertEquals(20, m.nextDir(d, 64));
    assertEquals(20, m.nextDir(d, 68));

    assertEquals(30, m.nextDir(d, 69));
    assertEquals(30, m.nextDir(d, 70));
    assertEquals(30, m.nextDir(d, 71));

    assertEquals(30, m.nextDir(d, 72));
    assertEquals(30, m.nextDir(d, 73));
  }
示例#3
0
  @Test
  public void test_next_dir() {
    BTreeMap.DirNode d =
        new BTreeMap.DirNode(
            new Integer[] {44, 62, 68, 71}, false, false, false, mkchild(10, 20, 30, 40));

    assertEquals(10, m.nextDir(d, 62));
    assertEquals(10, m.nextDir(d, 44));
    assertEquals(10, m.nextDir(d, 48));

    assertEquals(20, m.nextDir(d, 63));
    assertEquals(20, m.nextDir(d, 64));
    assertEquals(20, m.nextDir(d, 68));

    assertEquals(30, m.nextDir(d, 69));
    assertEquals(30, m.nextDir(d, 70));
    assertEquals(30, m.nextDir(d, 71));

    assertEquals(40, m.nextDir(d, 72));
    assertEquals(40, m.nextDir(d, 73));
  }