/*******************************************************************************
- * Copyright (c) 2013 Ericsson
+ * Copyright (c) 2013, 2014 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
public void testDefaultConstructor() {
assertEquals("getValue", 0, ts0.getValue());
assertEquals("getscale", -9, ts0.getScale());
- assertEquals("getPrecision", 0, ts0.getPrecision());
}
@Test
public void testFullConstructor() {
assertEquals("getValue", 12345, ts1.getValue());
assertEquals("getscale", -9, ts1.getScale());
- assertEquals("getPrecision", 0, ts1.getPrecision());
}
@Test
assertEquals("getValue", ts1.getValue(), copy.getValue());
assertEquals("getscale", ts1.getScale(), copy.getScale());
- assertEquals("getPrecision", ts1.getPrecision(), copy.getPrecision());
assertEquals("getValue", 12345, copy.getValue());
assertEquals("getscale", -9, copy.getScale());
- assertEquals("getPrecision", 0, copy.getPrecision());
}
@Test
ITmfTimestamp ts = ts0.normalize(0, 0);
assertEquals("getValue", 0, ts.getValue());
assertEquals("getscale", 0, ts.getScale());
- assertEquals("getPrecision", 0, ts.getPrecision());
ts = ts0.normalize(12345, 0);
assertEquals("getValue", 12345, ts.getValue());
assertEquals("getscale", 0, ts.getScale());
- assertEquals("getPrecision", 0, ts.getPrecision());
ts = ts0.normalize(10, 0);
assertEquals("getValue", 10, ts.getValue());
assertEquals("getscale", 0, ts.getScale());
- assertEquals("getPrecision", 0, ts.getPrecision());
ts = ts0.normalize(-10, 0);
assertEquals("getValue", -10, ts.getValue());
assertEquals("getscale", 0, ts.getScale());
- assertEquals("getPrecision", 0, ts.getPrecision());
}
@Test
ITmfTimestamp ts = ts0.normalize(0, 1);
assertEquals("getValue", 0, ts.getValue());
assertEquals("getscale", 1, ts.getScale());
- assertEquals("getPrecision", 0, ts.getPrecision());
ts = ts0.normalize(12345, 1);
assertEquals("getValue", 12345, ts.getValue());
assertEquals("getscale", 1, ts.getScale());
- assertEquals("getPrecision", 0, ts.getPrecision());
ts = ts0.normalize(10, 1);
assertEquals("getValue", 10, ts.getValue());
assertEquals("getscale", 1, ts.getScale());
- assertEquals("getPrecision", 0, ts.getPrecision());
ts = ts0.normalize(-10, 1);
assertEquals("getValue", -10, ts.getValue());
assertEquals("getscale", 1, ts.getScale());
- assertEquals("getPrecision", 0, ts.getPrecision());
}
// ------------------------------------------------------------------------
@Test
public void testCompareTo() {
- final ITmfTimestamp ts0a = new TmfTimestamp(0, 2, 0);
+ final ITmfTimestamp ts0a = new TmfTimestamp(0, 2);
final ITmfTimestamp ts1a = new TmfTimestamp(123450, -10);
final ITmfTimestamp ts2a = new TmfTimestamp(-12340, -10);
TmfTimestamp expectd = new TmfNanoTimestamp(5);
ITmfTimestamp delta = tstamp0.getDelta(tstamp1);
- assertEquals("getDelta", 0, delta.compareTo(expectd, false));
+ assertEquals("getDelta", 0, delta.compareTo(expectd));
// Delta for same scale and precision (delta < 0)
tstamp0 = new TmfTimestamp(5);
expectd = new TmfTimestamp(-5);
delta = tstamp0.getDelta(tstamp1);
- assertEquals("getDelta", 0, delta.compareTo(expectd, false));
+ assertEquals("getDelta", 0, delta.compareTo(expectd));
}
@Test
final TmfTimestamp expectd = new TmfTimestamp(0, 0);
final ITmfTimestamp delta = tstamp0.getDelta(tstamp1);
- assertEquals("getDelta", 0, delta.compareTo(expectd, false));
+ assertEquals("getDelta", 0, delta.compareTo(expectd));
}
}