|
2 | 2 | * Assigned to public domain. Use as you wish without restriction.
|
3 | 3 | */
|
4 | 4 |
|
| 5 | +// sigc::signal<>.slots() is deprecated, but let's keep the test if possible. |
| 6 | +// If libsigc++ is configured with -Dbuild-deprecated-api=false |
| 7 | +// (--disable-deprecated-api), SIGCXX_DISABLE_DEPRECATED is defined in |
| 8 | +// sigc++config.h. An undef at the start of this file has no effect. |
| 9 | +#undef SIGCXX_DISABLE_DEPRECATED |
| 10 | + |
5 | 11 | #include "testutilities.h"
|
6 | 12 | #include <sigc++/trackable.h>
|
7 | 13 | #include <sigc++/signal.h>
|
@@ -103,11 +109,20 @@ int main(int argc, char* argv[])
|
103 | 109 | util->check_result(result_stream, "sig is connected to foo, bar (size=2): foo(2) bar(2) ");
|
104 | 110 |
|
105 | 111 | A a; // iterators stay valid after further connections.
|
| 112 | +#ifndef SIGCXX_DISABLE_DEPRECATED |
106 | 113 | cona = sig.slots().insert(conbar, sigc::mem_fun1(a, &A::foo));
|
| 114 | +#else |
| 115 | + cona = sig.connect(sigc::mem_fun1(a, &A::foo)); |
| 116 | +#endif |
107 | 117 | result_stream << "sig is connected to foo, A::foo, bar (size=" << sig.size() << "): ";
|
108 | 118 | sig(3);
|
| 119 | +#ifndef SIGCXX_DISABLE_DEPRECATED |
109 | 120 | util->check_result(result_stream,
|
110 | 121 | "sig is connected to foo, A::foo, bar (size=3): foo(3) A::foo(3) bar(3) ");
|
| 122 | +#else |
| 123 | + util->check_result(result_stream, |
| 124 | + "sig is connected to foo, A::foo, bar (size=3): foo(3) bar(3) A::foo(3) "); |
| 125 | +#endif |
111 | 126 |
|
112 | 127 | conbar->disconnect(); // manual disconnection
|
113 | 128 | result_stream << "sig is connected to foo, A::foo (size=" << sig.size() << "): ";
|
|
0 commit comments