feat: add network connections
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <memory>
|
||||
#include "Engine/Network/NetworkManager.h"
|
||||
#include "Engine/Operator/GeometryOperator.h"
|
||||
#include "Engine/Types.h"
|
||||
@@ -14,12 +15,17 @@ TEST_CASE("network")
|
||||
REQUIRE(nm->isValidOp(newOpId));
|
||||
if(nm->isValidOp(newOpId))
|
||||
{
|
||||
nt::GeometryOperator& newOp = nm->getGeoOperator(newOpId);
|
||||
REQUIRE(newOp.setInput(0, newOpId2));
|
||||
auto newConnection = std::make_shared<nt::GeometryConnection>(newOpId, 1, newOpId2, 3);
|
||||
|
||||
auto inputOp = nm->getGeoOperator(newOpId);
|
||||
auto outputOp = nm->getGeoOperator(newOpId2);
|
||||
|
||||
// set output on the upper operator
|
||||
outputOp.addOutputConnection(newConnection);
|
||||
|
||||
// set input on the lower operator
|
||||
inputOp.addInputConnection(newConnection);
|
||||
|
||||
std::optional<nt::OpId> returnOpId = newOp.getInput(0);
|
||||
REQUIRE(returnOpId.has_value());
|
||||
REQUIRE(*returnOpId==newOpId2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user