#include #include #include #include "Engine/Network/NetworkManager.h" #include "Engine/Operator/GeometryOperator.h" #include "Engine/Types.h" #include "Engine/Operator/OperatorTable.h" #include struct NMReset { NMReset() { enzo::nt::nm()._reset(); } ~NMReset() { enzo::nt::nm()._reset(); } }; // TODO: fix this init monstrosity struct OperatorTableInit { OperatorTableInit() { enzo::op::OperatorTable::initPlugins(); } }; static OperatorTableInit _operatorTableInit; auto testOpInfo = enzo::op::OperatorTable::getOpInfo("house").value(); TEST_CASE_METHOD(NMReset, "Network Manager") { using namespace enzo; auto& nm = nt::nm(); nt::OpId startOp = nm.addOperator(testOpInfo); nt::OpId prevOp = startOp; std::vector prevOps; for(int k=0; k<10; k++) { for(int i=0; i<4; ++i) { nt::OpId newOp = nm.addOperator(testOpInfo); prevOps.push_back(newOp); nt::connectOperators(newOp, i, prevOp, 0); } for(int j=0; j<10; j++) { std::vector prevOpsBuffer = prevOps; for(int i=0; i