From 2b524ff8fe74164e4d438ab01079d3365f6e662e Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 13 Nov 2020 18:31:04 +0000 Subject: Fix generated hook member expr Had previously used the exchange name, not the member name. --- slicer/test/functions.ice | 1 + slicer/test/serializers.cpp | 4 ++-- slicer/tool/parser.cpp | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/slicer/test/functions.ice b/slicer/test/functions.ice index baedc6d..d5022f0 100644 --- a/slicer/test/functions.ice +++ b/slicer/test/functions.ice @@ -8,6 +8,7 @@ module Functions { }; ["slicer:implementation:Functions.FuncsSubImpl"] local class FuncsSub extends Funcs { + ["slicer:name:Test-Value"] string testVal; }; local struct SFuncs { diff --git a/slicer/test/serializers.cpp b/slicer/test/serializers.cpp index b161e7f..26e4ad8 100644 --- a/slicer/test/serializers.cpp +++ b/slicer/test/serializers.cpp @@ -677,7 +677,7 @@ BOOST_AUTO_TEST_CASE(DeserializeJsonAbstractDefault) BOOST_AUTO_TEST_CASE(DeserializeJsonAbstractImpl) { - auto in = json::parseValue(R"J({ "obj": {"slicer-typeid": "::Functions::FuncsSub", "testVal": "value"} })J"); + auto in = json::parseValue(R"J({ "obj": {"slicer-typeid": "::Functions::FuncsSub", "Test-Value": "value"} })J"); auto obj = Slicer::DeserializeAny(in); BOOST_REQUIRE(obj.obj); auto impl = std::dynamic_pointer_cast(obj.obj); @@ -704,7 +704,7 @@ BOOST_AUTO_TEST_CASE(DeserializeXmlAbstractImpl) std::stringstream in(R"X( - value + value )X"); auto obj = Slicer::DeserializeAny(in); diff --git a/slicer/tool/parser.cpp b/slicer/tool/parser.cpp index 79ea98a..595cff4 100644 --- a/slicer/tool/parser.cpp +++ b/slicer/tool/parser.cpp @@ -416,8 +416,8 @@ namespace Slicer { fprintbf(cpp, " %s, ", Slice::typeToString(type, dm->optional())); createNewModelPartPtrFor(type, dm, md); fprintbf(cpp, ", %d", md.countSlicerMetaData()); - fprintbf(cpp, R"( > hook_C%d_%s {&%s, "%s", "%s", &hstr_C%d_%s)", components, name, dm->scoped(), name, - lname, components, name); + fprintbf(cpp, R"( > hook_C%d_%s {&%s, "%s", "%s", &hstr_C%d_%s)", components, dm->name(), dm->scoped(), + name, lname, components, dm->name()); if (md.hasSlicerMetaData()) { fprintbf(cpp, ","); copyMetadata(md); -- cgit v1.2.3