MCPcopy Create free account
hub / github.com/chrxh/alien / TEST_F

Function TEST_F

source/EngineTests/DetonatorTests.cpp:31–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29};
30
31TEST_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
57TEST_F(DetonatorTests, activateDetonator)
58{

Callers

nothing calls this directly

Calls 7

NerveDescriptionClass · 0.85
sizeMethod · 0.80
CellDescriptionClass · 0.50
setSimulationDataMethod · 0.45
calcTimestepsMethod · 0.45
getSimulationDataMethod · 0.45

Tested by

no test coverage detected