summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-11-13 18:31:04 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2020-11-13 19:25:48 +0000
commit2b524ff8fe74164e4d438ab01079d3365f6e662e (patch)
treed193b6bca6abd0ed6927c79544012aef6733774d
parentUntemplate hooks equal range and related bits (diff)
downloadslicer-2b524ff8fe74164e4d438ab01079d3365f6e662e.tar.bz2
slicer-2b524ff8fe74164e4d438ab01079d3365f6e662e.tar.xz
slicer-2b524ff8fe74164e4d438ab01079d3365f6e662e.zip
Fix generated hook member expr
Had previously used the exchange name, not the member name.
-rw-r--r--slicer/test/functions.ice1
-rw-r--r--slicer/test/serializers.cpp4
-rw-r--r--slicer/tool/parser.cpp4
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<Slicer::JsonValueDeserializer, Functions::SFuncs>(in);
BOOST_REQUIRE(obj.obj);
auto impl = std::dynamic_pointer_cast<Functions::FuncsSub>(obj.obj);
@@ -704,7 +704,7 @@ BOOST_AUTO_TEST_CASE(DeserializeXmlAbstractImpl)
std::stringstream in(R"X(
<SFuncs>
<obj slicer-typeid="::Functions::FuncsSub">
- <testVal>value</testVal>
+ <Test-Value>value</Test-Value>
</obj>
</SFuncs>)X");
auto obj = Slicer::DeserializeAny<Slicer::XmlStreamDeserializer, Functions::SFuncs>(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);