Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed May 10, 2023
1 parent 3e8dd53 commit 027ee50
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
15 changes: 5 additions & 10 deletions cpp/mrc/tests/test_edges.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <glog/logging.h>
#include <gtest/gtest.h>
#include <gtest/internal/gtest-internal.h>
#include <rxcpp/rx.hpp> // for observable_member

#include <functional>
#include <map>
Expand Down Expand Up @@ -290,18 +291,12 @@ class TestRxNodeComponent : public RxNodeComponent<T, T>
void make_stream(stream_fn_t fn)
{
return base_t::make_stream([this, fn](auto&&... args) {
m_stream_fn_called = true;
stream_fn_called = true;
return fn(std::forward<decltype(args)>(args)...);
});
}

~TestRxNodeComponent() override
{
// Debug print
VLOG(10) << "Destroying TestRxNodeComponent";
}

bool m_stream_fn_called = false;
bool stream_fn_called = false;
};

template <typename T>
Expand Down Expand Up @@ -560,7 +555,7 @@ TEST_F(TestEdges, SourceToRxNodeComponentToSinkComponent)

source->run();

EXPECT_TRUE(node->m_stream_fn_called);
EXPECT_TRUE(node->stream_fn_called);
}

TEST_F(TestEdges, SourceComponentToNodeToSinkComponent)
Expand Down Expand Up @@ -999,6 +994,6 @@ TEST_F(TestEdges, EdgeTapWithSpliceRxComponent)
source->run();
sink->run();

EXPECT_TRUE(node->m_stream_fn_called);
EXPECT_TRUE(node->stream_fn_called);
}
} // namespace mrc
4 changes: 2 additions & 2 deletions cpp/mrc/tests/test_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "test_mrc.hpp"

#include "mrc/channel/status.hpp" // for Status
#include "mrc/core/executor.hpp"
#include "mrc/engine/pipeline/ipipeline.hpp"
#include "mrc/node/rx_node.hpp"
Expand Down Expand Up @@ -45,6 +46,7 @@
#include <mutex>
#include <set>
#include <sstream>
#include <stdexcept> // for runtime_error
#include <string>
#include <thread>
#include <utility>
Expand Down Expand Up @@ -510,11 +512,9 @@ TEST_F(TestNode, RxNodeComponentThrows)
"sinkInt",
[&](const int& x) {
++sink_call_count;
DVLOG(1) << "Sink got value: '" << x << "'" << std::endl;
},
[&]() {
++complete_count;
DVLOG(1) << "Sink on_completed" << std::endl;
});

seg.make_edge(source, node_comp);
Expand Down

0 comments on commit 027ee50

Please sign in to comment.