From c96861bd29cce4b6d67c7593a870bc44e3ecb3d6 Mon Sep 17 00:00:00 2001 From: Rudolf Weeber Date: Mon, 14 Jan 2019 22:58:54 +0100 Subject: [PATCH] Testsuite: test particle deletion --- testsuite/python/particle.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/testsuite/python/particle.py b/testsuite/python/particle.py index c899798db6c..f544109ac48 100644 --- a/testsuite/python/particle.py +++ b/testsuite/python/particle.py @@ -248,7 +248,7 @@ def test_parallel_property_setters(self): "If this test hangs, there is an mpi deadlock in a particle property setter.") for p in espressomd.particle_data.particle_attributes: # Uncomment to identify guilty property - #print( p) + # print( p) if not hasattr(s.part[0], p): raise Exception( @@ -260,7 +260,19 @@ def test_parallel_property_setters(self): # Cause a differtn mpi callback to uncover deadlock immediately x = getattr(s.part[:], p) + def test_zz_remove_all(self): + for id in self.system.part[:].id: + self.system.part[id].remove() + self.system.part.add(pos=np.random.random( + (100, 3)) * self.system.box_l, id=np.arange(100, dtype=int)) + ids = self.system.part[:].id + np.random.shuffle(ids) + for id in ids: + self.system.part[id].remove() + with self.assertRaises(Exception): + self.system.part[17].remove() + if __name__ == "__main__": - #print("Features: ", espressomd.features()) + # print("Features: ", espressomd.features()) ut.main()