Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
victimsnino committed Nov 3, 2024
1 parent 652e362 commit 1cccfe4
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/tests/utils/disposable_observable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void test_operator_over_observable_finish_before_dispose(auto&& op)
template<typename T>
void test_operator_over_observable_with_disposable(auto&& op)
{
SUBCASE("operator disposes disposable")
SUBCASE("operator disposes disposable but not too early")
{
auto observable_disposable = rpp::composite_disposable_wrapper::make();
std::optional<rpp::dynamic_observer<T>> saved_observer{};
Expand All @@ -94,20 +94,6 @@ void test_operator_over_observable_with_disposable(auto&& op)
auto observer_disposable = rpp::composite_disposable_wrapper::make();
op(observable) | rpp::ops::subscribe(observer_disposable, [](const auto&) {});

observer_disposable.dispose();
CHECK(observable_disposable.is_disposed());
}

SUBCASE("operator doesn't disposes disposable too early")
{
auto observable_disposable = rpp::composite_disposable_wrapper::make();
auto observable = rpp::source::create<T>([&observable_disposable](auto&& obs) {
obs.set_upstream(observable_disposable);
});

auto observer_disposable = rpp::composite_disposable_wrapper::make();
op(observable) | rpp::ops::subscribe(observer_disposable, [](const auto&) {});

CHECK(!observable_disposable.is_disposed());
observer_disposable.dispose();
CHECK(observable_disposable.is_disposed());
Expand Down

0 comments on commit 1cccfe4

Please sign in to comment.