tmf : Add test to StateSystemTest
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Tue, 2 Jul 2013 14:25:46 +0000 (10:25 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 4 Jul 2013 22:48:20 +0000 (18:48 -0400)
This new test will check if the very first interval gets set correctly
in certain cases. This exposed a bug with in-memory backends, which
was fixed in 9898079defaa94bc3f0cf60dc89b1e863ac304da.

Change-Id: I2c79530091eae5f761fa945214b9f46e1cc4457b
Signed-off-by: Jean-Christian Kouamé
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/14116
Tested-by: Hudson CI
org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemTest.java

index b9ddedd4fafed21b4df9e69568dc5c0d95c5435f..487e4b7542c203fa0440933a807d7293f4953b26 100644 (file)
@@ -145,8 +145,8 @@ public abstract class StateSystemTest {
     }
 
     /**
-     * Range query, but with a t2 far off the end of the trace.
-     * The result should still be valid.
+     * Range query, but with a t2 far off the end of the trace. The result
+     * should still be valid.
      */
     @Test
     public void testRangeQuery2() {
@@ -405,4 +405,22 @@ public abstract class StateSystemTest {
             fail();
         }
     }
+
+    @Test
+    public void testFirstIntervalIsConsidered() {
+        try {
+            List<ITmfStateInterval> list = ssq.queryFullState(1331668248014135800L);
+            ITmfStateInterval interval = list.get(233);
+            assertEquals(1331668247516664825L, interval.getStartTime());
+
+            int valueInt = interval.getStateValue().unboxInt();
+            assertEquals(1, valueInt);
+        } catch (TimeRangeException e) {
+            fail();
+        } catch (StateSystemDisposedException e) {
+            fail();
+        } catch (StateValueTypeException e) {
+            fail();
+        }
+    }
 }
This page took 0.026149 seconds and 5 git commands to generate.