From 9e1d68a6e36b9859b7245816bfb44e8a6905da06 Mon Sep 17 00:00:00 2001 From: Alex Robenko Date: Mon, 19 Jun 2023 08:47:24 +1000 Subject: [PATCH 1/2] Updating next release to be v6.2.1 --- lib/include/commsdsl/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/include/commsdsl/version.h b/lib/include/commsdsl/version.h index 5520f6e9..5491e191 100644 --- a/lib/include/commsdsl/version.h +++ b/lib/include/commsdsl/version.h @@ -26,7 +26,7 @@ #define COMMSDSL_MINOR_VERSION 2U /// @brief Patch level of the library -#define COMMSDSL_PATCH_VERSION 0U +#define COMMSDSL_PATCH_VERSION 1U /// @brief Macro to create numeric version as single unsigned number #define COMMSDSL_MAKE_VERSION(major_, minor_, patch_) \ From 8766fdedf727d7020d0f2040a0a790578aa8d301 Mon Sep 17 00:00:00 2001 From: Alex Robenko Date: Wed, 9 Aug 2023 08:18:35 +1000 Subject: [PATCH 2/2] Fixes to the generated "selectField()" member function of the field. --- app/commsdsl2comms/src/CommsVariantField.cpp | 2 +- app/commsdsl2comms/test/test28/test28Test.th | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/commsdsl2comms/src/CommsVariantField.cpp b/app/commsdsl2comms/src/CommsVariantField.cpp index de9f00bb..1fc56d69 100644 --- a/app/commsdsl2comms/src/CommsVariantField.cpp +++ b/app/commsdsl2comms/src/CommsVariantField.cpp @@ -1035,7 +1035,7 @@ std::string CommsVariantField::commsDefSelectFieldCodeInternal() const " return;\n" " }\n\n" " reset();\n" - " switch (Base::currentField()) {\n" + " switch (idx) {\n" " #^#CASES#$#\n" " default: break;\n" " }\n" diff --git a/app/commsdsl2comms/test/test28/test28Test.th b/app/commsdsl2comms/test/test28/test28Test.th index 7da41ee9..a565d267 100644 --- a/app/commsdsl2comms/test/test28/test28Test.th +++ b/app/commsdsl2comms/test/test28/test28Test.th @@ -11,6 +11,7 @@ class TestSuite : public CxxTest::TestSuite public: void test1(); void test2(); + void test3(); using Interface = test28::Message< @@ -55,3 +56,12 @@ void TestSuite::test2() Msg2 msg; msg.field_f1().initField_p120().field_val().value() = 0xff; } + +void TestSuite::test3() +{ + Msg1 msg; + msg.field_variant1().initField_p1(); + TS_ASSERT_EQUALS(msg.field_variant1().currentField(), 0U); + msg.field_variant1().selectField(1U); + TS_ASSERT_EQUALS(msg.field_variant1().currentField(), 1U); +}