File tree Expand file tree Collapse file tree 5 files changed +50
-1
lines changed Expand file tree Collapse file tree 5 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 8
8
/test_bind_refptr
9
9
/test_bind_return
10
10
/test_compose
11
+ /test_connection
11
12
/test_copy_invalid_slot
12
13
/test_cpp11_lambda
13
14
/test_custom
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ set (TEST_SOURCE_FILES
25
25
test_bind_refptr.cc
26
26
test_bind_return.cc
27
27
test_compose.cc
28
+ test_connection.cc
28
29
test_copy_invalid_slot.cc
29
30
test_cpp11_lambda.cc
30
31
test_custom.cc
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ check_PROGRAMS = \
32
32
test_bind_refptr \
33
33
test_bind_return \
34
34
test_compose \
35
+ test_connection \
35
36
test_copy_invalid_slot \
36
37
test_cpp11_lambda \
37
38
test_custom \
@@ -75,6 +76,7 @@ test_bind_ref_SOURCES = test_bind_ref.cc $(sigc_test_util)
75
76
test_bind_refptr_SOURCES = test_bind_refptr.cc $(sigc_test_util )
76
77
test_bind_return_SOURCES = test_bind_return.cc $(sigc_test_util )
77
78
test_compose_SOURCES = test_compose.cc $(sigc_test_util )
79
+ test_connection_SOURCES = test_connection.cc $(sigc_test_util )
78
80
test_copy_invalid_slot_SOURCES = test_copy_invalid_slot.cc $(sigc_test_util )
79
81
test_cpp11_lambda_SOURCES = test_cpp11_lambda.cc $(sigc_test_util )
80
82
test_custom_SOURCES = test_custom.cc $(sigc_test_util )
Original file line number Diff line number Diff line change 5
5
# valgrind --leak-check=full .libs/lt-test_*
6
6
7
7
for testprog in test_accum_iter test_accumulated test_bind test_bind_as_slot \
8
- test_bind_ref test_bind_refptr test_bind_return test_compose \
8
+ test_bind_ref test_bind_refptr test_bind_return test_compose test_connection \
9
9
test_copy_invalid_slot test_cpp11_lambda test_custom test_disconnect \
10
10
test_disconnect_during_emit test_exception_catch test_hide \
11
11
test_limit_reference test_member_method_trait test_mem_fun test_ptr_fun \
Original file line number Diff line number Diff line change
1
+ /* Copyright 2019, The libsigc++ Development Team
2
+ * Assigned to public domain. Use as you wish without restriction.
3
+ */
4
+
5
+ #include " testutilities.h"
6
+ #include < sigc++/trackable.h>
7
+ #include < sigc++/signal.h>
8
+ #include < iostream>
9
+
10
+ namespace
11
+ {
12
+
13
+ TestUtilities* util = nullptr ;
14
+ std::ostringstream result_stream;
15
+
16
+ void
17
+ test_connection_copy_empty ()
18
+ {
19
+ sigc::connection con1;
20
+
21
+ // Try to prevent the compiler from optimising away the copy.
22
+ std::cout << &con1 << std::endl;
23
+
24
+ sigc::connection con2 (con1);
25
+
26
+ // Try to prevent the compiler from optimising away the copy.
27
+ std::cout << &con2 << std::endl;
28
+ }
29
+
30
+ } // end anonymous namespace
31
+
32
+ int
33
+ main (int argc, char * argv[])
34
+ {
35
+ util = TestUtilities::get_instance ();
36
+
37
+ if (!util->check_command_args (argc, argv))
38
+ return util->get_result_and_delete_instance () ? EXIT_SUCCESS : EXIT_FAILURE;
39
+
40
+ test_connection_copy_empty ();
41
+
42
+ // See also test_disconnection.cc
43
+
44
+ return util->get_result_and_delete_instance () ? EXIT_SUCCESS : EXIT_FAILURE;
45
+ }
You can’t perform that action at this time.
0 commit comments