| 29 | }; |
| 30 | |
| 31 | TEST_F(DetonatorTests, doNothing) |
| 32 | { |
| 33 | DataDescription data; |
| 34 | data.addCells( |
| 35 | {CellDescription() |
| 36 | .setId(1) |
| 37 | .setPos({10.0f, 10.0f}) |
| 38 | .setMaxConnections(2) |
| 39 | .setExecutionOrderNumber(0) |
| 40 | .setInputExecutionOrderNumber(5) |
| 41 | .setCellFunction(DetonatorDescription().setCountDown(14)), |
| 42 | }); |
| 43 | |
| 44 | _simulationFacade->setSimulationData(data); |
| 45 | _simulationFacade->calcTimesteps(1); |
| 46 | |
| 47 | auto actualData = _simulationFacade->getSimulationData(); |
| 48 | auto actualDetonatorCell = getCell(actualData, 1); |
| 49 | |
| 50 | EXPECT_EQ(1, actualData.cells.size()); |
| 51 | EXPECT_TRUE(approxCompare(getEnergy(data), getEnergy(actualData))); |
| 52 | EXPECT_TRUE(approxCompare(0.0f, actualDetonatorCell.signal.channels[0])); |
| 53 | EXPECT_EQ(14, std::get<DetonatorDescription>(*actualDetonatorCell.cellFunction).countdown); |
| 54 | EXPECT_EQ(DetonatorState_Ready, std::get<DetonatorDescription>(*actualDetonatorCell.cellFunction).state); |
| 55 | } |
| 56 | |
| 57 | TEST_F(DetonatorTests, activateDetonator) |
| 58 | { |
nothing calls this directly
no test coverage detected