Skip to content

Commit

Permalink
Add test for non-uniform buffer interactions (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
a5kin committed Jun 3, 2018
1 parent 5819ac8 commit 8d34e06
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/core/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
GameOfLife, GameOfLifeStatic, GameOfLifeColor, GameOfLife6D,
GOLExperiment, GOLExperiment2, GOLExperimentColor,
)
from examples.shifting_sands import ShiftingSands, ShiftingSandsExperiment


class TestCellularAutomaton(unittest.TestCase):
Expand Down Expand Up @@ -158,3 +159,11 @@ class GameOfLifeInt(GameOfLife):
cells = ca.cells_gpu.get()[:ca.cells_num].astype(np.uint8)
checksum = binascii.crc32(cells)
self.assertEqual(2981695958, checksum, "Wrong field checksum.")

def test_nonuniform_interactions(self):
"""Test non-uniform buffer interactions."""
ca = ShiftingSands(ShiftingSandsExperiment)
for j in range(self.num_steps):
ca.step()
checksum = binascii.crc32(ca.cells_gpu.get()[:ca.cells_num])
self.assertEqual(1117367015, checksum, "Wrong field checksum.")

0 comments on commit 8d34e06

Please sign in to comment.