diff --git a/src/proc/control/command-impl.hpp b/src/proc/control/command-impl.hpp index 1d00e77f5..acbd517f3 100644 --- a/src/proc/control/command-impl.hpp +++ b/src/proc/control/command-impl.hpp @@ -168,13 +168,13 @@ namespace control { void setArguments (Arguments& args) - { + { //////////////////////////////////////TICKET #1095 : explicit argument arity check here pClo_->bindArguments (args); } void setArguments (lib::diff::Rec const& paramData) - { + { //////////////////////////////////////TICKET #1095 : explicit argument arity check here pClo_->bindArguments (paramData); } diff --git a/tests/core/proc/control/command-setup-test.cpp b/tests/core/proc/control/command-setup-test.cpp index b1c51a6d6..9a6247838 100644 --- a/tests/core/proc/control/command-setup-test.cpp +++ b/tests/core/proc/control/command-setup-test.cpp @@ -34,6 +34,8 @@ //#include #include +#include + //using std::rand; @@ -48,6 +50,8 @@ namespace test { //using lib::time::Offset; using lib::Literal; using std::string; + using std::regex; + using std::regex_replace; @@ -66,6 +70,25 @@ namespace test { testString = "Ichthyostega wuz here"; cout << "after--->" << testString << endl; } + + + void + operate (string search, string replace) + { + testString = regex_replace (testString, regex(search), replace); + } + + string + capture (string, string) + { + return testString; + } + + void + undoIt (string, string, string oldVal) + { + testString = oldVal; + } } @@ -122,7 +145,14 @@ namespace test { CHECK (CommandSetup::pendingCnt() == 1); - CommandSetup def_1{"test.CommandSetup.def_1"}; + CommandSetup def_1 = CommandSetup{"test.CommandSetup.def_1"} + = [](CommandDef def) + { + def.operation (operate) + .captureUndo (capture) + .undoOperation (undoIt); + }; + CommandSetup def_2{"test.CommandSetup.def_2"}; //////////// does not compile -- copy assignment prohibited... @@ -136,7 +166,7 @@ namespace test { { size_t cnt = CommandSetup::invokeDefinitionClosures(); CHECK (CommandSetup::pendingCnt() == 0); - CHECK (cnt == 1); + CHECK (cnt == 2); CHECK (testString == "Ichthyostega wuz here"); TODO ("verify the command definitions happened"); }