Lumiera  0.pre.03
»edit your freedom«
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"
20 #include "lib/test/test-helper.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 
33 namespace steam {
34 namespace control {
35 namespace 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  {
70  command1::check_ = 0;
71  uint cnt_defs = Command::definition_count();
72  uint cnt_inst = Command::instance_count();
73 
74  // prepare a command definition (prototype)
75  CommandDef ("test.command1.1")
76  .operation (command1::operate)
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.
static size_t definition_count()
Definition: command.cpp:289
Definition: run.hpp:40
Steam-Layer implementation namespace root.
static size_t instance_count()
Definition: command.cpp:298
Simplistic test class runner.
A collection of frequently used helper functions to support unit testing.
Some dummy command functions used for building unit test cases.
Actually defining a command and binding it to execution parameters.