Test nested dynamic vla
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 17 Oct 2022 00:39:07 +0000 (20:39 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 17 Oct 2022 00:39:07 +0000 (20:39 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/test.c

index 64e0e76e71379fce7417dbb880ae4dbd1ff087f2..dbb4833093d48123bd156b3532cf713da11bcea8 100644 (file)
@@ -268,8 +268,10 @@ static side_define_event(my_provider_event_dynamic_vla,
 static
 void test_dynamic_vla(void)
 {
-       side_arg_dynamic_define_vec(myvla, side_arg_list(side_arg_u32(1), side_arg_u32(2), side_arg_u32(3)));
-
+       side_arg_dynamic_define_vec(myvla,
+               side_arg_list(
+                       side_arg_dynamic_u32(1), side_arg_dynamic_u32(2), side_arg_dynamic_u32(3))
+               );
        my_provider_event_dynamic_vla.enabled = 1;
        side_event(&my_provider_event_dynamic_vla,
                side_arg_list(side_arg_dynamic(side_arg_dynamic_vla(&myvla))));
@@ -386,9 +388,13 @@ static
 void test_dynamic_map_vla(void)
 {
        side_arg_dynamic_define_vec(myvla,
-               side_arg_list(side_arg_u32(1), side_arg_u32(2), side_arg_u32(3)));
+               side_arg_list(
+                       side_arg_dynamic_u32(1), side_arg_dynamic_u32(2), side_arg_dynamic_u32(3))
+               );
        side_arg_dynamic_define_vec(myvla2,
-               side_arg_list(side_arg_u32(4), side_arg_u64(5), side_arg_u32(6)));
+               side_arg_list(
+                       side_arg_dynamic_u32(4), side_arg_dynamic_u64(5), side_arg_dynamic_u32(6))
+               );
        side_arg_dynamic_define_map(mymap,
                side_arg_list(
                        side_arg_dynamic_field("a", side_arg_dynamic_vla(&myvla)),
@@ -400,6 +406,37 @@ void test_dynamic_map_vla(void)
                side_arg_list(side_arg_dynamic(side_arg_dynamic_map(&mymap))));
 }
 
+static side_define_event(my_provider_event_dynamic_nested_vla,
+       "myprovider", "mydynamicnestedvla", SIDE_LOGLEVEL_DEBUG,
+       side_field_list(
+               side_field(SIDE_TYPE_DYNAMIC, "dynamic"),
+       )
+);
+
+static
+void test_dynamic_nested_vla(void)
+{
+       side_arg_dynamic_define_vec(nestedvla,
+               side_arg_list(
+                       side_arg_dynamic_u32(1), side_arg_dynamic_u16(2), side_arg_dynamic_u32(3),
+               )
+       );
+       side_arg_dynamic_define_vec(nestedvla2,
+               side_arg_list(
+                       side_arg_dynamic_u8(4), side_arg_dynamic_u32(5), side_arg_dynamic_u32(6),
+               )
+       );
+       side_arg_dynamic_define_vec(myvla,
+               side_arg_list(
+                       side_arg_dynamic_vla(&nestedvla),
+                       side_arg_dynamic_vla(&nestedvla2),
+               )
+       );
+       my_provider_event_dynamic_nested_vla.enabled = 1;
+       side_event(&my_provider_event_dynamic_nested_vla,
+               side_arg_list(side_arg_dynamic(side_arg_dynamic_vla(&myvla))));
+}
+
 int main()
 {
        test_fields();
@@ -417,5 +454,6 @@ int main()
        test_dynamic_nested_map();
        test_dynamic_vla_map();
        test_dynamic_map_vla();
+       test_dynamic_nested_vla();
        return 0;
 }
This page took 0.027381 seconds and 4 git commands to generate.