From 3e9ec8f3d60d13ff2a1edf43e846e81075c6be5a Mon Sep 17 00:00:00 2001 From: heck Date: Tue, 9 Feb 2021 00:47:23 +0100 Subject: [PATCH] lib_test - add function/test returning struct containing array of structs --- examples/lib/lib_test/functions.h | 2 +- examples/lib/lib_test/main.c | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/lib/lib_test/functions.h b/examples/lib/lib_test/functions.h index 4a4edf9..4a583a2 100644 --- a/examples/lib/lib_test/functions.h +++ b/examples/lib/lib_test/functions.h @@ -106,7 +106,7 @@ TTAPSa*** func_pppTTAPSa_args_pppTTAPSa(TTAPSa*** arg1_pppTTAPSa); // CS - Complex Structs containing array // CS contains a PS[3] (which is an array of structs) // By value -TACS func_TACS_args_V(); // MISSING +TACS func_TACS_args_V(); TACS func_TACS_args_TACS(TACS arg1_TACS); // MISSING diff --git a/examples/lib/lib_test/main.c b/examples/lib/lib_test/main.c index 11b6060..52d3278 100644 --- a/examples/lib/lib_test/main.c +++ b/examples/lib/lib_test/main.c @@ -263,17 +263,17 @@ int main() { assert(inout->field__P_1 == 23); assert(!strcmp(inout->field__Pa_1, "pEp")); } -// { -// printf("testing: func_TACS_args_V\n"); -// TACS ret = func_TACS_args_V(); -// assert(ret.field__PS_1.field__P_1 == 23); -// assert(ret.field__PS_1.field__P_2 == 23); -// assert(ret.field_APS_1[0].field__P_1 == 23); -// assert(ret.field_APS_1[0].field__P_2 == 24); -// assert(ret.field_APS_1[1].field__P_1 == 25); -// assert(ret.field_APS_1[1].field__P_2 == 26); -// assert(ret.field_APS_1[2].field__P_1 == 27); -// assert(ret.field_APS_1[2].field__P_2 == 28); -// } + { + printf("testing: func_TACS_args_V\n"); + TACS ret = func_TACS_args_V(); + assert(ret.field__PS_1.field__P_1 == 23); + assert(ret.field__PS_1.field__P_2 == 23); + assert(ret.field_APS_1[0].field__P_1 == 23); + assert(ret.field_APS_1[0].field__P_2 == 24); + assert(ret.field_APS_1[1].field__P_1 == 25); + assert(ret.field_APS_1[1].field__P_2 == 26); + assert(ret.field_APS_1[2].field__P_1 == 27); + assert(ret.field_APS_1[2].field__P_2 == 28); + } }