X-Git-Url: https://git.dlugolecki.net.pl/?p=command.git;a=blobdiff_plain;f=tests%2Fcallable%2Finvokes_class_method.cpp;fp=tests%2Fcallable%2Finvokes_class_method.cpp;h=3b0de6b0c6b59e8f396f961347545b20d53fc813;hp=0000000000000000000000000000000000000000;hb=ae6743a2a2c69b7a927f64ff1d3abf38a5e7d4bc;hpb=948c501fbb8d47898a9c92697327c5ffa70a898f diff --git a/tests/callable/invokes_class_method.cpp b/tests/callable/invokes_class_method.cpp new file mode 100644 index 0000000..3b0de6b --- /dev/null +++ b/tests/callable/invokes_class_method.cpp @@ -0,0 +1,35 @@ +#include +#include + +#include // std::bind, _1 + +#include "TestCallable.h" +#include "callable.h" + +using namespace std; +using namespace command; + +bool test = false; + +class Class { +public: + void method(void) { + test = true; + }; +}; + +int main() { + Class c; + TestCallable callable(std::bind(&Class::method, &c)); + callable.callFunction(); + + if (test == true) { + cout << "Callable class calls provided class member method\n"; + return 0; + } + + cout << "Callable class does not call provided member method\n"; + + return 1; +} +