diff --git a/tests/test.cpp b/tests/test.cpp --- a/tests/test.cpp +++ b/tests/test.cpp @@ -123,6 +123,12 @@ TEST_CASE("sink", "[memory, stream]") REQUIRE(follower.hasX() == true); } +TEST_CASE("sink must be created unconnected", "[memory, stream]") +{ + TestSink sink; + REQUIRE(sink.connectedSource() == NULL); +} + class TestSource : public Source { public: @@ -185,6 +191,18 @@ TEST_CASE("source", "[memory, stream]") REQUIRE(sink.totalFed == 100); } +TEST_CASE("source must set/unset sink 'source'", "[memory, stream]") +{ + TestSink sink; + TestSource source(3, false); + + source.connect(&sink); + REQUIRE(sink.connectedSource() == &source); + + source.disconnect(&sink); + REQUIRE(sink.connectedSource() == NULL); +} + TEST_CASE("IndexBuffer", "[memory, buffer]") { IndexBuffer buf(10);