ss.tests: Add unit test for intervals before start time
authorGeneviève Bastien <gbastien+lttng@versatic.net>
Mon, 18 Apr 2016 16:20:26 +0000 (12:20 -0400)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Wed, 6 Jul 2016 16:01:07 +0000 (12:01 -0400)
Change-Id: I42704a18810e5b7899d24addbed9d17221289ac8
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/70887
Reviewed-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Tested-by: Alexandre Montplaisir <alexmonthy@efficios.com>
statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/StateHistoryBackendTestBase.java
statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/ThreadedHistoryTreeBackendTest.java

index e841c5b821fbb42a0cc9802abdb64f60562c87ce..e091a48eeb258fa9b61fccf2afea6bdd22280e43 100644 (file)
@@ -438,4 +438,19 @@ public abstract class StateHistoryBackendTestBase {
             fail(e.getMessage());
         }
     }
+
+    /**
+     * Test inserting an interval before the start of the backend
+     */
+    @Test(expected = TimeRangeException.class)
+    public void testIntervalBeforeStart() {
+        long startTime = 1000;
+        try {
+            IStateHistoryBackend backend = getBackendForBuilding(startTime);
+            backend.insertPastState(startTime - 1, startTime + 1, 0, INT_VAL1);
+        } catch (IOException e) {
+            fail(e.getMessage());
+        }
+    }
+
 }
index 0076985bbb03672cfce28d3be8bbfb346a52452e..9c4948e1233ca8425503367efa27a275833ed85c 100644 (file)
@@ -14,6 +14,7 @@ import java.io.IOException;
 
 import org.eclipse.tracecompass.internal.statesystem.core.backend.historytree.ThreadedHistoryTreeBackend;
 import org.eclipse.tracecompass.statesystem.core.backend.IStateHistoryBackend;
+import org.junit.Test;
 
 /**
  * Test the {@link ThreadedHistoryTreeBackend} class.
@@ -43,4 +44,11 @@ public class ThreadedHistoryTreeBackendTest extends HistoryTreeBackendTest {
         fBackendMap.put(backend, historyTreeFile);
         return backend;
     }
+
+    @Override
+    @Test
+    public void testIntervalBeforeStart() {
+        // Exception is thrown in a thread, so we can't catch it
+    }
+
 }
This page took 0.026325 seconds and 5 git commands to generate.