use of org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp in project tracecompass by tracecompass.
the class TmfTimeRangeTest method testEqualsEndTime.
@Test
public void testEqualsEndTime() {
final ITmfTimestamp ts1 = TmfTimestamp.fromSeconds(12345);
final ITmfTimestamp ts2 = TmfTimestamp.fromSeconds(12350);
final ITmfTimestamp ts3 = TmfTimestamp.fromSeconds(12355);
final TmfTimeRange range1 = new TmfTimeRange(ts1, ts2);
final TmfTimeRange range2 = new TmfTimeRange(ts1, ts3);
final TmfTimeRange range3 = new TmfTimeRange(ts2, ts3);
assertTrue("equals", !range1.equals(range2));
assertTrue("equals", !range1.equals(range3));
}
use of org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp in project tracecompass by tracecompass.
the class TmfTimeRangeTest method testHashCode.
// ------------------------------------------------------------------------
// hashCode
// ------------------------------------------------------------------------
@Test
public void testHashCode() {
final ITmfTimestamp ts1 = TmfTimestamp.fromSeconds(12345);
final ITmfTimestamp ts2 = TmfTimestamp.fromSeconds(12350);
final TmfTimeRange range1 = new TmfTimeRange(ts1, ts2);
final TmfTimeRange range1b = new TmfTimeRange(ts1, ts2);
final TmfTimeRange range2 = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
final TmfTimeRange range2b = new TmfTimeRange(TmfTimestamp.BIG_BANG, TmfTimestamp.BIG_CRUNCH);
assertTrue("hashCode", range1.hashCode() == range1b.hashCode());
assertTrue("hashCode", range2.hashCode() == range2b.hashCode());
assertTrue("hashCode", range1.hashCode() != range2.hashCode());
}
use of org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp in project tracecompass by tracecompass.
the class TmfTimeRangeTest method testConstructor.
// ------------------------------------------------------------------------
// Constructors
// ------------------------------------------------------------------------
@Test
public void testConstructor() {
final ITmfTimestamp ts1 = TmfTimestamp.fromSeconds(12345);
final ITmfTimestamp ts2 = TmfTimestamp.fromSeconds(12350);
final TmfTimeRange range = new TmfTimeRange(ts1, ts2);
assertEquals("startTime", ts1, range.getStartTime());
assertEquals("endTime", ts2, range.getEndTime());
}
use of org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp in project tracecompass by tracecompass.
the class TmfTimeRangeTest method testOpenRange1.
@Test
public void testOpenRange1() {
final ITmfTimestamp ts2 = TmfTimestamp.fromSeconds(12350);
final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, ts2);
assertEquals("startTime", TmfTimestamp.BIG_BANG, range.getStartTime());
assertEquals("endTime", ts2, range.getEndTime());
}
use of org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp in project tracecompass by tracecompass.
the class TmfTimeRangeTest method testEqualStartTime.
@Test
public void testEqualStartTime() {
final ITmfTimestamp ts1 = TmfTimestamp.fromSeconds(12345);
final ITmfTimestamp ts2 = TmfTimestamp.fromSeconds(12350);
final ITmfTimestamp ts3 = TmfTimestamp.fromSeconds(12355);
final TmfTimeRange range1 = new TmfTimeRange(ts1, ts3);
final TmfTimeRange range2 = new TmfTimeRange(ts2, ts3);
final TmfTimeRange range3 = new TmfTimeRange(ts1, ts2);
assertTrue("equals", !range1.equals(range2));
assertTrue("equals", !range1.equals(range3));
}
Aggregations