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

Function TEST_F

source/EngineTests/StatisticsTests.cpp:22–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20};
21
22TEST_F(StatisticsTests, selfReplicatorWithRepetitionsInGenome)
23{
24 auto subGenome = GenomeDescriptionService::get().convertDescriptionToBytes(
25 GenomeDescription().setHeader(GenomeHeaderDescription().setNumRepetitions(3)).setCells({CellGenomeDescription()}));
26 auto mainGenome = GenomeDescriptionService::get().convertDescriptionToBytes(
27 GenomeDescription()
28 .setHeader(GenomeHeaderDescription().setNumRepetitions(2))
29 .setCells({
30 CellGenomeDescription().setCellFunction(ConstructorGenomeDescription().setGenome(subGenome)),
31 CellGenomeDescription().setCellFunction(ConstructorGenomeDescription().setMakeSelfCopy()),
32 }));
33
34 DataDescription data;
35 data.addCells({
36 CellDescription().setId(1).setCellFunction(ConstructorDescription().setGenome(mainGenome)),
37 });
38
39 _simulationFacade->setSimulationData(data);
40 auto statistics = _simulationFacade->getRawStatistics();
41
42 EXPECT_EQ(1, statistics.timeline.timestep.numCells[0]);
43 EXPECT_EQ(1, statistics.timeline.timestep.numSelfReplicators[0]);
44 EXPECT_EQ(10, statistics.timeline.timestep.numGenomeCells[0]);
45}
46
47TEST_F(StatisticsTests, selfReplicatorWithInfiniteRepetitionsInGenome)
48{

Callers

nothing calls this directly

Calls 10

GenomeDescriptionClass · 0.85
setGenomeMethod · 0.80
CellDescriptionClass · 0.50
setSimulationDataMethod · 0.45
getRawStatisticsMethod · 0.45

Tested by

no test coverage detected