public void test_addressingContiguous(){
  final Journal store=(Journal)getStore();
  try {
    final RWStrategy bufferStrategy=(RWStrategy)store.getBufferStrategy();
    final RWStore rw=bufferStrategy.getStore();
    final int cSlotSize=128;
    final int cAllocSize=99;
    long pap=rw.physicalAddress(rw.alloc(cAllocSize,null));
    for (int i=0; i < 500000; i++) {
      final int a=rw.alloc(cAllocSize,null);
      final long pa=rw.physicalAddress(a);
      if (pa != (pap + cSlotSize)) {
        rw.physicalAddress(a);
        fail("Non-Contiguous slots: " + i + ", "+ pa+ "!="+ (pap + cSlotSize));
      }
      pap=pa;
    }
    store.commit();
    final StringBuilder sb=new StringBuilder();
    rw.showAllocators(sb);
    log.warn(sb.toString());
  }
  finally {
    store.destroy();
  }
}

public void test_addressingContiguous ( ) { final Journal store = ( Journal ) getStore ( ) ; try { final RWStrategy bufferStrategy = ( RWStrategy ) store . getBufferStrategy ( ) ; final RWStore rw = bufferStrategy . getStore ( ) ; final int cSlotSize = 128 ; final int cAllocSize = 99 ; long pap = rw . physicalAddress ( rw . alloc ( cAllocSize , null ) ) ; for ( int i = 0 ; i < 500000 ; i ++ ) { final int a = rw . alloc ( cAllocSize , null ) ; final long pa = rw . physicalAddress ( a ) ; if ( pa != ( pap + cSlotSize ) ) { rw . physicalAddress ( a ) ; fail ( "Non-Contiguous slots: " + i + ", " + pa + "!=" + ( pap + cSlotSize ) ) ; } pap = pa ; } store . commit ( ) ; final StringBuilder sb = new StringBuilder ( ) ; rw . showAllocators ( sb ) ; log . warn ( sb . toString ( ) ) ; } finally { store . destroy ( ) ; } }
ensures the allocation of unique addresses by mapping allocated address with uniqueness assertion against physical address .
