@Test
public void testBinarySearch() {
for (long i = 0; i < CHECKPOINTS_INSERT_NUM; i++) {
- TmfCheckpoint checkpoint = new TmfCheckpoint(new TmfTimestamp(i), new TmfLongLocation(i), 0);
+ TmfCheckpoint checkpoint = new TmfCheckpoint(TmfTimestamp.fromSeconds(i), new TmfLongLocation(i), 0);
fFlatArray.insert(checkpoint);
}
- TmfCheckpoint expectedCheckpoint = new TmfCheckpoint(new TmfTimestamp(122), new TmfLongLocation(122L), 0);
+ TmfCheckpoint expectedCheckpoint = new TmfCheckpoint(TmfTimestamp.fromSeconds(122), new TmfLongLocation(122L), 0);
int expectedRank = 122;
long rank = fFlatArray.binarySearch(expectedCheckpoint);
for (int i = 0; i < CHECKPOINTS_INSERT_NUM; i++) {
int checkpointIndex = list.get(i);
- TmfCheckpoint checkpoint = new TmfCheckpoint(new TmfTimestamp(12345 + checkpointIndex),
+ TmfCheckpoint checkpoint = new TmfCheckpoint(TmfTimestamp.fromSeconds(12345 + checkpointIndex),
new TmfLongLocation(123456L + checkpointIndex), checkpointIndex);
ITmfCheckpoint found = fFlatArray.get(checkpointIndex);
assertEquals(checkpoint, found);