Skip to content
Snippets Groups Projects
Commit a04deccf authored by Kristoffer Richardsson's avatar Kristoffer Richardsson
Browse files

#119 Added system test for memory mapping operations on reused Crazyflie object

parent d142a29d
No related branches found
No related tags found
No related merge requests found
...@@ -60,6 +60,20 @@ class TestMemoryMapping(unittest.TestCase): ...@@ -60,6 +60,20 @@ class TestMemoryMapping(unittest.TestCase):
with Swarm(uris, factory=factory) as swarm: with Swarm(uris, factory=factory) as swarm:
swarm.parallel_safe(self.assert_memory_mapping) swarm.parallel_safe(self.assert_memory_mapping)
def test_memory_mapping_with_reuse_of_cf_object(self):
# Fixture
uri = self.test_rig_support.all_uris[0]
self.test_rig_support.restart_devices([uri])
cf = Crazyflie(rw_cache='./cache')
# Test and Assert
for connections in range(10):
with SyncCrazyflie(uri, cf=cf) as scf:
for mem_ops in range(5):
self.assert_memory_mapping(scf)
# Utils
def assert_memory_mapping(self, scf): def assert_memory_mapping(self, scf):
mems = scf.cf.mem.get_mems(MemoryElement.TYPE_MEMORY_TESTER) mems = scf.cf.mem.get_mems(MemoryElement.TYPE_MEMORY_TESTER)
count = len(mems) count = len(mems)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment