From cfe192f8c6beb37a9c413b6583e9cfe112db46a9 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 16 Apr 2017 19:38:56 +0200 Subject: [PATCH] Commands: some unit test coverage for unbinding arguments ...just to make sure it is properly integrated with the state predicates --- tests/core/proc/control/command-use1-test.cpp | 12 ++++++++++++ tests/tool/vgsuppression.c | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/tests/core/proc/control/command-use1-test.cpp b/tests/core/proc/control/command-use1-test.cpp index 10bad27fd..cb8e7d4da 100644 --- a/tests/core/proc/control/command-use1-test.cpp +++ b/tests/core/proc/control/command-use1-test.cpp @@ -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()); } diff --git a/tests/tool/vgsuppression.c b/tests/tool/vgsuppression.c index 846d034b1..37bf5eb09 100644 --- a/tests/tool/vgsuppression.c +++ b/tests/tool/vgsuppression.c @@ -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; }