Skip to content

Commit

Permalink
add RunSimulationsInput test to test setting input
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhus22 committed Jun 3, 2024
1 parent fc494e2 commit e5adc61
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/sim_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ TEST(Automata, RunSimulation) {
EXPECT_FALSE(ca.run());
}

TEST(Automata, RunSimulationsInput) {
std::vector<unsigned int> rule = {
0,0,0,1,0,0,0,0,0,
0,0,1,1,0,0,0,0,0
};
unsigned int states = 2;
pyaccell::Automata ca(rule, states);
std::vector<unsigned int> input;
for (int i=0; i<ca.sim_height * ca.sim_width; i++) {
input.push_back((unsigned int)(1));
}
ca.input = input;
EXPECT_FALSE(ca.run(1));
for (int i=0; i<10; i++)
EXPECT_EQ(1, ca.output[i]);
}

/*
#include <pyaccell/engine.hpp>
Tests for function implementation (no longer used)
Expand Down

0 comments on commit e5adc61

Please sign in to comment.