summaryrefslogtreecommitdiff
path: root/tests/test_exception_catch.cc
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2016-03-02 09:46:07 +0100
committerMurray Cumming <murrayc@murrayc.com>2016-03-07 10:42:43 +0100
commit3fa66e030cf2b389891768a5a6eb40ce3c314f2f (patch)
treee734b10fc58be6b13971481411635503bc8197bf /tests/test_exception_catch.cc
parente8c83eaff4690c52e279e50d2e1ee4bb85a4cad5 (diff)
downloadsigc++-3fa66e030cf2b389891768a5a6eb40ce3c314f2f.tar.gz
exception_catch_functor::operator():
Remove the unnecessary operator()() overload. This did need me to change the test code so that it doesn't try to provide a catch function that returns something, but that seems more correct anyway.
Diffstat (limited to 'tests/test_exception_catch.cc')
-rw-r--r--tests/test_exception_catch.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/test_exception_catch.cc b/tests/test_exception_catch.cc
index f8f6e02..6ae7e51 100644
--- a/tests/test_exception_catch.cc
+++ b/tests/test_exception_catch.cc
@@ -63,6 +63,23 @@ struct my_catch
}
};
+struct my_catch_void
+{
+ void operator()()
+ {
+ try
+ {
+ throw;
+ }
+ catch (std::range_error e) // catch what types we know
+ {
+ result_stream << "caught " << e.what();
+ }
+
+ // all else continues out.
+ }
+};
+
} // end anonymous namespace
int main(int argc, char* argv[])
@@ -78,7 +95,7 @@ int main(int argc, char* argv[])
result_stream << sigc::exception_catch(g(), my_catch())();
util->check_result(result_stream, "g() caught out of range 1");
- sigc::exception_catch(g_void(), my_catch())(); // void test
+ sigc::exception_catch(g_void(), my_catch_void())(); // void test
util->check_result(result_stream, "g_void() caught out of range ");
return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE;