Skip to content

Commit

Permalink
✅ add unit test for random layout generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Drewniok committed Dec 1, 2023
1 parent a6db7cd commit 1fcbf55
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from mnt.pyfiction import *
import unittest
import os


class TestRandomSiDBLayoutGenerator(unittest.TestCase):

def test_area_with_one_coordinate(self):
params = generate_random_sidb_layout_params()
params.number_of_sidbs = 1
params.coordinate_pair = ((10,10), (10,10))
result_lyt = generate_random_sidb_layout(sidb_layout(), params)
self.assertEqual(result_lyt.num_cells(), 1)
cell = (result_lyt.cells())[0]
self.assertEqual(cell.x, 10)
self.assertEqual(cell.y, 10)

if __name__ == '__main__':
unittest.main()
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ struct critical_temperature_params
*/
NON_GATE_BASED_SIMULATION
};

/**
* An enumeration of simulation modes (exact vs. approximate) to use for the *Critical Temperature* Simulation.
*/
Expand Down

0 comments on commit 1fcbf55

Please sign in to comment.