TMF: Add get parent to state system
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.kernel.core.tests / src / org / eclipse / linuxtools / lttng2 / kernel / core / tests / stateprovider / StateSystemTest.java
index 2f46cc34e4e0b1be50abf5c1906bd33afda2de32..8a3708a71af24b471be0da33050e65ca4fdfb76f 100644 (file)
@@ -422,4 +422,25 @@ public abstract class StateSystemTest {
             fail();
         }
     }
+
+    @Test
+    public void testParentAttribute() {
+        String[] path = { "CPUs/0/Current_thread",
+                          "CPUs/0",
+                          "CPUs" };
+        try {
+            int q = ssq.getQuarkAbsolute(Attributes.CPUS, "0", Attributes.CURRENT_THREAD);
+            for (int i = 0; i < path.length; i++) {
+                String name = ssq.getFullAttributePath(q);
+                assertEquals(path[i], name);
+                q = ssq.getParentAttributeQuark(q);
+            }
+            assertEquals(-1, q);
+            q = ssq.getParentAttributeQuark(q);
+            assertEquals(-1, q);
+        } catch (AttributeNotFoundException e) {
+            fail();
+        }
+    }
+
 }
This page took 0.040028 seconds and 5 git commands to generate.