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) Lumiera.org
5  2009, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
28 #include "lib/test/run.hpp"
29 #include "lib/test/test-helper.hpp"
31 //#include "lib/format-cout.hpp"
32 //#include "lib/util.hpp"
33 
35 
36 //#include <functional>
37 //#include <boost/ref.hpp>
38 //#include <cstdlib>
39 //#include <string>
40 
41 
42 namespace steam {
43 namespace control {
44 namespace test {
45 
46 
47  //using util::contains;
48 // using std::function;
49 // using std::bind;
50 // using std::string;
51  //using std::rand;
52 // using lib::test::showSizeof;
53 // using util::isSameObject;
54 // using util::contains;
55 
56 
57 
58 
59 
60 
61 
62  /***********************************************************************/
72  class CommandUse3_test : public Test
73  {
74 
75 
76  virtual void
77  run (Arg)
78  {
79  command1::check_ = 0;
80  uint cnt_defs = Command::definition_count();
81  uint cnt_inst = Command::instance_count();
82 
83  // prepare a command definition (prototype)
84  CommandDef ("test.command1.1")
85  .operation (command1::operate)
86  .captureUndo (command1::capture)
87  .undoOperation (command1::undoIt);
88 
89  UNIMPLEMENTED ("more elaborate command handling patterns");
91 
92  CHECK (cnt_inst == Command::instance_count());
93 
94  Command::remove ("test.command1.1");
95  CHECK (cnt_defs == Command::definition_count());
96  }
97 
98 
99 
100  };
101 
102 
104  LAUNCHER (CommandUse3_test, "function controller");
105 
106 
107 }}} // namespace steam::control::test
Helper class used solely for defining a Command-Object.
static size_t definition_count()
Definition: command.cpp:298
Definition: run.hpp:49
Steam-Layer implementation namespace root.
static size_t instance_count()
Definition: command.cpp:307
Simple 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.