tests: add `src.ctf.fs` single field testing framework
[babeltrace.git] / tests / data / plugins / src.ctf.fs / field / ctf-1 / pass-variant.mp
diff --git a/tests/data/plugins/src.ctf.fs/field/ctf-1/pass-variant.mp b/tests/data/plugins/src.ctf.fs/field/ctf-1/pass-variant.mp
new file mode 100644 (file)
index 0000000..3b01754
--- /dev/null
@@ -0,0 +1,24 @@
+---
+struct {
+  enum : u8 {
+    MEOW,
+    MIX,
+  } tag;
+
+  variant <tag> {
+    u16 MEOW;
+    nt_str MIX;
+  } var;
+} @[2]
+
+---
+00                # `tag`
+[1995:16]         # `var`
+
+01                # `tag`
+"hello there!\0"  # `var`
+---
+- tag: 0
+  var: 1995
+- tag: 1
+  var: "hello there!"
This page took 0.024839 seconds and 4 git commands to generate.