Bugfix: must init TreeMutator explicitly now

as consequence of previous fix.
Also, when building the preconfigured TreeMutator for GenNode,
the init hook must be called explicitly now.
This commit is contained in:
Fischlurch 2016-10-04 03:24:44 +02:00
parent 1725a31df1
commit 22f06dca23
3 changed files with 6 additions and 1 deletions

View file

@ -379,7 +379,7 @@ namespace diff{
using Target = typename TreeDiffTraits<TAR>::Ret;
Target target = mutatorBinding (subject_);
buildMutator (target)->init();
buildMutator(target)->init();
TreeDiffMutatorBinding::scopeManger_ = &scopes_;
TreeDiffMutatorBinding::treeMutator_ = &scopes_.currentScope();
REQUIRE (this->treeMutator_);

View file

@ -654,6 +654,7 @@ namespace diff{
{
mutateInPlace (target.data.get<Rec>())
.buildMutator(buff);
buff.get()->init();
return true;
}
else

View file

@ -89,6 +89,8 @@ namespace test{
<< " type="<< typeStr(mutator)
<< endl;
mutator.init();
CHECK (isnil (localData));
string testValue{"that would be acceptable"};
mutator.assignElm ({"lore", testValue});
@ -120,6 +122,8 @@ namespace test{
<< " type="<< typeStr(mutator)
<< endl;
mutator.init();
CHECK (isnil (values));
CHECK (mutator.matchSrc (GenNode("a")));
mutator.skipSrc (GenNode("a"));