Commands: some unit test coverage for unbinding arguments

...just to make sure it is properly integrated with the state predicates
This commit is contained in:
Fischlurch 2017-04-16 19:38:56 +02:00
parent bb7bba5dc2
commit cfe192f8c6
2 changed files with 16 additions and 0 deletions

View file

@ -192,6 +192,11 @@ namespace test {
CHECK ( Command::defined("test.command1.2"));
CHECK ( Command::canExec("test.command1.2"));
CHECK ( Command::canUndo("test.command1.2"));
com.unbind(); // revert to pristine state
CHECK ( Command::defined("test.command1.2"));
CHECK (!Command::canExec("test.command1.2"));
CHECK (!Command::canUndo("test.command1.2"));
}
@ -283,6 +288,13 @@ namespace test {
CHECK (23 == command1::check_);
c2.undo();
CHECK (0 == command1::check_);
// remove argument bindings per instance and return to pristine state
c4.unbind();
CHECK (c2.canExec());
CHECK (c2.canUndo());
CHECK (not c4.canExec());
CHECK (not c4.canUndo());
}

View file

@ -44,6 +44,9 @@ lumiera_error_get (void);
lumiera_err
lumiera_error_set (lumiera_err, const char*);
lumiera_err
lumiera_error (void);
int
main ()
@ -58,6 +61,7 @@ main ()
/* lumiera_error_get() mallocs a LumieraErrorcontext for each thread */
lumiera_error_get();
lumiera_error_set("dummy","dummy");
lumiera_error();
return 0;
}