Skip to content

Changes

Summary

  1. tmf: Bug 581427: handle BIG_BANG/BIG_CRUNCH in TmfTimestamp#getDelta (details)
Commit f1dd159e49080921fa2bdae1360c80865e318ce8 by Matthew Khouzam
tmf: Bug 581427: handle BIG_BANG/BIG_CRUNCH in TmfTimestamp#getDelta

TmfTimestamp.BIG_CRUNCH.getDelta(TmfTimestamp.BIG_BANG) leads to an
invalid result due to an overflow.

Time deltas involving any of those two special values are defined as:

  BIG_BANG   - BIG_BANG   == ZERO
  BIG_CRUNCH - BIG_CRUNCH == ZERO

  BIG_BANG   - <anything other than BIG_BANG>   == BIG_BANG
  BIG_CRUNCH - <anything other than BIG_CRUNCH> == BIG_CRUNCH

  <anything other than BIG_BANG> - BIG_BANG     == BIG_CRUNCH
  <anything other than BIG_CRUNCH> - BIG_CRUNCH == BIG_BANG

Also, add tests to cover this.

Bug 581427

Change-Id: Ibb71126af0fee338c74791ed0e4ac8bd5cb87de6
Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/199616
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
The file was modified tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfTimestamp.java (diff)
The file was modified tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/TmfTimestampTest.java (diff)
The file was modified tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfTimestampDelta.java (diff)
The file was modified tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/TmfTimestampDeltaTest.java (diff)