Skip to content

Commit

Permalink
obsolete test removed
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Nov 23, 2024
1 parent 16e23c2 commit f1f5ac9
Showing 1 changed file with 0 additions and 58 deletions.
58 changes: 0 additions & 58 deletions source/EngineTests/TransmitterTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,61 +412,3 @@ TEST_F(TransmitterTests, distributeToReadyConstructors)

EXPECT_TRUE(approxCompare(getEnergy(data), getEnergy(actualData)));
}

TEST_F(TransmitterTests, distributeFromNotReadyToReadyConstructors)
{
_parameters.cellFunctionConstructorCheckCompletenessForSelfReplication = true;
_simulationFacade->setSimulationParameters(_parameters);

auto subgenome = GenomeDescription().setCells({CellGenomeDescription()});

auto genome = GenomeDescription().setCells({
CellGenomeDescription().setCellFunction(ConstructorGenomeDescription().setMakeSelfCopy()),
CellGenomeDescription().setCellFunction(TransmitterGenomeDescription()),
CellGenomeDescription().setCellFunction(ConstructorGenomeDescription().setGenome(GenomeDescriptionService::get().convertDescriptionToBytes(subgenome))),
});

DataDescription data;
data.addCells({
CellDescription()
.setId(1)
.setPos({9.0f, 10.0f})
.setMaxConnections(1)
.setExecutionOrderNumber(0)
.setEnergy(_parameters.cellNormalEnergy[0] * 2)
.setCellFunction(ConstructorDescription().setNumInheritedGenomeNodes(4).setGenome(GenomeDescriptionService::get().convertDescriptionToBytes(genome))),
CellDescription()
.setId(2)
.setPos({10.0f, 10.0f})
.setMaxConnections(2),
CellDescription()
.setId(3)
.setPos({11.0f, 10.0f})
.setMaxConnections(2)
.setExecutionOrderNumber(0)
.setCellFunction(ConstructorDescription().setGenome(GenomeDescriptionService::get().convertDescriptionToBytes(subgenome))),
CellDescription().setId(4).setPos({12.0f, 10.0f}).setMaxConnections(1).setExecutionOrderNumber(0),
});
data.addConnection(1, 2);
data.addConnection(2, 3);

_simulationFacade->setSimulationData(data);
_simulationFacade->calcTimesteps(7);

auto actualData = _simulationFacade->getSimulationData();

auto origReplicator = getCell(data, 1);
auto actualReplicator = getCell(actualData, 1);

auto origOtherCell = getCell(data, 2);
auto actualOtherCell = getCell(actualData, 2);

auto origConstructor = getCell(data, 3);
auto actualConstructor = getCell(actualData, 3);

EXPECT_TRUE(actualReplicator.energy < origReplicator.energy - NEAR_ZERO);
EXPECT_TRUE(approxCompare(actualOtherCell.energy, origOtherCell.energy));
EXPECT_TRUE(actualConstructor.energy > origConstructor.energy + NEAR_ZERO);

EXPECT_TRUE(approxCompare(getEnergy(data), getEnergy(actualData)));
}

0 comments on commit f1f5ac9

Please sign in to comment.