[libsigcplusplus/variadic_mem_fun3: 3/148] test_ptr_fun: Fix the build, at least temporarily.



commit e10e8807dec85f40af09318a008fad0b999c1b98
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jan 7 11:29:59 2016 +0100

    test_ptr_fun: Fix the build, at least temporarily.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=753612#c11

 tests/test_ptr_fun.cc |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/tests/test_ptr_fun.cc b/tests/test_ptr_fun.cc
index 1784aed..fa8e9b6 100644
--- a/tests/test_ptr_fun.cc
+++ b/tests/test_ptr_fun.cc
@@ -61,12 +61,15 @@ int main(int argc, char* argv[])
   if (!util->check_command_args(argc, argv))
     return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE;
 
-  sigc::ptr_fun(&foo)();
+  //Test use of overloaded functions that differ by number of parameters
+  //and by return type
+  sigc::ptr_fun<int>(&foo)();
   util->check_result(result_stream, "foo()");
 
-  sigc::ptr_fun(&foo)(1);
+  sigc::ptr_fun<void>(&foo)(1);
   util->check_result(result_stream, "foo(int 1)");
 
+  //Test use of overloaded functions that differ by parameter type:
 #if ENABLE_TEST_OF_OVERLOADED_FUNCTIONS
   sigc::ptr_fun<void, char>(&bar)(2);
   util->check_result(result_stream, "bar(char 2)");
@@ -74,11 +77,11 @@ int main(int argc, char* argv[])
   sigc::ptr_fun<void, float>(&bar)(2.0f);
   util->check_result(result_stream, "bar(float 2)");
 #else
-  sigc::ptr_fun(&bar)(2.0f);
+  sigc::ptr_fun<void>(&bar)(2.0f);
   util->check_result(result_stream, "bar(float 2)");
 #endif
 
-  sigc::ptr_fun(&bar)(3, 5);
+  sigc::ptr_fun<double>(&bar)(3, 5);
   util->check_result(result_stream, "bar(int 3, int 5)");
 
   sigc::ptr_fun(&test::foo)();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]