Skip to content

Commit

Permalink
[unittests][dataflow] try to fix random crash
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasPaulin committed Feb 27, 2023
1 parent 3d690a3 commit f0a736d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/unittest/Dataflow/customnodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ TEST_CASE( "Dataflow/Core/Custom nodes", "[Dataflow][Core][Custom nodes]" ) {
REQUIRE( inputThreshold != nullptr );

auto filteredCollection = g->getDataGetter( "rs_from" );
auto generatedOperator = g->getDataGetter( "nm_from" );
REQUIRE( filteredCollection != nullptr );
auto generatedOperator = g->getDataGetter( "nm_from" );
REQUIRE( generatedOperator != nullptr );

auto r = g->compile();
REQUIRE( r );
// parameterise the graph
using CollectionType = Ra::Core::VectorArray<Scalar>;
CollectionType testVector;
Expand All @@ -205,10 +205,15 @@ TEST_CASE( "Dataflow/Core/Custom nodes", "[Dataflow][Core][Custom nodes]" ) {
}
std::cout << '\n';

/// Getters are usable only after successful compilation/execution of the graph
auto r = g->compile();
REQUIRE( r );

// execute the graph that filter out nothing
// execute
r = g->execute();
REQUIRE( r );

// Get results as references (no need to get them again later)
auto& vres = filteredCollection->getData<CollectionType>();
auto& vop = generatedOperator->getData<std::string>();
Expand Down

0 comments on commit f0a736d

Please sign in to comment.