diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-03-12 11:13:57 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-03-12 11:14:03 +0100 |
commit | dd4ffcec0ea561e16c4621b31712166717db3e0b (patch) | |
tree | 287c1b988fa2d912ff4f830317d77482b554f0b7 /src/test | |
parent | 164d7b674b49b3c062d0331f28d21ad4f6bf5207 (diff) | |
parent | 9519a9a4202cd5fcaaad6d4cf0bf6bad38a27369 (diff) |
Merge pull request #5859
9519a9a Add correct bool combiner for net signals (Pieter Wuille)
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/main_tests.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/main_tests.cpp b/src/test/main_tests.cpp index 1927f3deab..9ec533bcca 100644 --- a/src/test/main_tests.cpp +++ b/src/test/main_tests.cpp @@ -23,4 +23,21 @@ BOOST_AUTO_TEST_CASE(subsidy_limit_test) BOOST_CHECK(nSum == 2099999997690000ULL); } +bool ReturnFalse() { return false; } +bool ReturnTrue() { return true; } + +BOOST_AUTO_TEST_CASE(test_combiner_all) +{ + boost::signals2::signal<bool (), CombinerAll> Test; + BOOST_CHECK(Test()); + Test.connect(&ReturnFalse); + BOOST_CHECK(!Test()); + Test.connect(&ReturnTrue); + BOOST_CHECK(!Test()); + Test.disconnect(&ReturnFalse); + BOOST_CHECK(Test()); + Test.disconnect(&ReturnTrue); + BOOST_CHECK(Test()); +} + BOOST_AUTO_TEST_SUITE_END() |