Skip to content

Commit

Permalink
sigh: more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Jul 5, 2019
1 parent 23aa097 commit 52e7b50
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions test/entt/signal/sigh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,27 @@ TEST(SigH, ScopedConnectionConstructorsAndOperators) {
ASSERT_FALSE(listener.k);
ASSERT_FALSE(conn);

auto basic = sink.connect<&sigh_listener::g>(&listener);
entt::scoped_connection inner = std::move(basic);
entt::scoped_connection inner{};
inner = sink.connect<&sigh_listener::g>(&listener);
sigh.publish(42);

ASSERT_FALSE(sigh.empty());
ASSERT_TRUE(listener.k);
ASSERT_TRUE(inner);

inner.release();

ASSERT_TRUE(sigh.empty());
ASSERT_FALSE(inner);

auto basic = sink.connect<&sigh_listener::g>(&listener);
inner = std::as_const(basic);
sigh.publish(42);

ASSERT_FALSE(sigh.empty());
ASSERT_FALSE(listener.k);
ASSERT_TRUE(inner);

conn = std::move(inner);

ASSERT_FALSE(inner);
Expand All @@ -263,7 +276,7 @@ TEST(SigH, ScopedConnectionConstructorsAndOperators) {
sigh.publish(42);

ASSERT_TRUE(sigh.empty());
ASSERT_TRUE(listener.k);
ASSERT_FALSE(listener.k);
}

TEST(SigH, ConstNonConstNoExcept) {
Expand Down

0 comments on commit 52e7b50

Please sign in to comment.