Skip to content

Commit

Permalink
Add genetics stuff to base tests (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
a5kin committed Apr 4, 2019
1 parent 18c290b commit 6619e65
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/core/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
GOLExperiment, GOLExperiment2, GOLExperimentColor,
)
from examples.shifting_sands import ShiftingSands, ShiftingSandsExperiment
from examples.evolife import EvoLife, CrossbreedingExperiment


class TestCellularAutomaton(unittest.TestCase):
Expand Down Expand Up @@ -189,3 +190,12 @@ def test_unset_viewport(self):
with self.assertRaises(XenticaException):
model = ShiftingSands(ShiftingSandsExperiment)
model.render()

def test_genetics_general(self):
"""Test general genetics stuff."""
model = EvoLife(CrossbreedingExperiment)
for _ in range(self.num_steps):
model.step()
cells = model.gpu.arrays.cells.get()[:model.cells_num]
checksum = binascii.crc32(cells)
self.assertEqual(3142230500, checksum, "Wrong field checksum.")

0 comments on commit 6619e65

Please sign in to comment.