Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
command-use3-test.cpp
Go to the documentation of this file.
1/*
2 CommandUse3(Test) - usage aspects III
3
4 Copyright (C)
5 2009, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12* *****************************************************************/
13
19#include "lib/test/run.hpp"
22//#include "lib/format-cout.hpp"
23//#include "lib/util.hpp"
24
26
27//#include <functional>
28//#include <boost/ref.hpp>
29//#include <cstdlib>
30//#include <string>
31
32
33namespace steam {
34namespace control {
35namespace test {
36
37
38 //using util::contains;
39// using std::function;
40// using std::bind;
41// using std::string;
42 //using std::rand;
43// using lib::test::showSizeof;
44// using util::isSameObject;
45// using util::contains;
46
47
48
49
50
51
52
53 /***********************************************************************/
63 class CommandUse3_test : public Test
64 {
65
66
67 virtual void
68 run (Arg)
69 {
72 uint cnt_inst = Command::instance_count();
73
74 // prepare a command definition (prototype)
75 CommandDef ("test.command1.1")
77 .captureUndo (command1::capture)
78 .undoOperation (command1::undoIt);
79
80 UNIMPLEMENTED ("more elaborate command handling patterns");
82
83 CHECK (cnt_inst == Command::instance_count());
84
85 Command::remove ("test.command1.1");
86 CHECK (cnt_defs == Command::definition_count());
87 }
88
89
90
91 };
92
93
95 LAUNCHER (CommandUse3_test, "function controller");
96
97
98}}} // namespace steam::control::test
Helper class used solely for defining a Command-Object.
auto operation(FUN operation_to_define)
static size_t definition_count()
Definition command.cpp:289
static bool remove(Symbol cmdID)
Definition command.cpp:241
static size_t instance_count()
Definition command.cpp:298
Actually defining a command and binding it to execution parameters.
unsigned int uint
Definition integral.hpp:29
enable_if_c< Cond::value, T >::type enable_if
SFINAE helper to control the visibility of specialisations and overloads.
Definition meta/util.hpp:87
void undoIt(int, int64_t oldVal)
int64_t check_
< test command just adding a given value
Steam-Layer implementation namespace root.
Test runner and basic definitions for tests.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Definition run.hpp:116
Some dummy command functions used for building unit test cases.
A collection of frequently used helper functions to support unit testing.