7322da546907379b60858267d6164225c6db2fef
[command.git] / tests / callable / invokes_provided_function.cpp
1 #include <cstring>
2 #include <iostream>
3
4 #include "TestCallable.h"
5 #include "callable.h"
6
7 using namespace std;
8 using namespace command;
9
10 bool test = false;
11
12 void function(bool val) {
13     test = val;
14 };
15
16 int main() {
17
18     TestCallable<bool> callable(function);
19     callable.callFunction(true);
20
21     if (test == true) {
22         cout << "Callable class calls provided function\n";
23         return 0;
24     }
25
26     cout << "Callable class does not call provided function\n";
27
28     return 1;
29 }
30