1 /* Copyright 2005, The libsigc++ Development Team
2 * Assigned to public domain. Use as you wish without restriction.
5 #include "testutilities.h"
6 #include <sigc++/functors/slot.h>
13 std::ostringstream result_stream;
17 result_stream << "Foo";
22 result_stream << "Bar";
25 } // end anonymous namespace
27 int main(int argc, char* argv[])
29 auto util = TestUtilities::get_instance();
31 if (!util->check_command_args(argc, argv))
32 return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE;
34 //Note that sigc::ptr_fun() creates a sigc::pointer_functor0.
35 sigc::slot<void> theSlot(sigc::ptr_fun(&Foo));
37 util->check_result(result_stream, "Foo");
41 util->check_result(result_stream, "");
43 theSlot = sigc::ptr_fun(&Bar);
45 util->check_result(result_stream, "Bar");
47 theSlot = sigc::slot<void>(); // Assign an empty slot.
49 util->check_result(result_stream, "");
51 return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE;