Commit f65bfb0b authored by Markus Holzer's avatar Markus Holzer
Browse files

testing

parent 8a565966
Pipeline #40102 failed with stages
in 16 minutes and 52 seconds
...@@ -26,12 +26,12 @@ class BlockforestModuleTest(unittest.TestCase): ...@@ -26,12 +26,12 @@ class BlockforestModuleTest(unittest.TestCase):
blocks = createUniformBlockGrid(blocks=(1, 1, 1), cellsPerBlock=(2, 2, 2)) blocks = createUniformBlockGrid(blocks=(1, 1, 1), cellsPerBlock=(2, 2, 2))
field.addToStorage(blocks, "TestField", np.int64) field.addToStorage(blocks, "TestField", np.int64)
npf = field.toArray(blocks[0]["TestField"]) npf = field.toArray(blocks[0]["TestField"])
npf[:, :, :] = 42.0 npf[:, :, :] = 42
del blocks del blocks
# create another block structure - this has triggered segfault # create another block structure - this has triggered segfault
# when previous blockstructure was already freed # when previous blockstructure was already freed
blocks = createUniformBlockGrid(blocks=(1, 1, 1), cellsPerBlock=(2, 2, 2)) # noqa: F841 blocks = createUniformBlockGrid(blocks=(1, 1, 1), cellsPerBlock=(2, 2, 2)) # noqa: F841
self.assertEqual(npf[0, 0, 0], 42.0) self.assertEqual(npf[0, 0, 0], 42)
def testMemoryManagement3(self): def testMemoryManagement3(self):
"""Same as testMemoryManagement2, but with iterators""" """Same as testMemoryManagement2, but with iterators"""
...@@ -42,10 +42,10 @@ class BlockforestModuleTest(unittest.TestCase): ...@@ -42,10 +42,10 @@ class BlockforestModuleTest(unittest.TestCase):
if name == "TestField": if name == "TestField":
f = block[name] f = block[name]
npf = field.toArray(f) npf = field.toArray(f)
npf[:, :, :] = 42.0 npf[:, :, :] = 42
del blocks, block, name, f del blocks, block, name, f
blocks = createUniformBlockGrid(blocks=(1, 1, 1), cellsPerBlock=(2, 2, 2)) # noqa: F841 blocks = createUniformBlockGrid(blocks=(1, 1, 1), cellsPerBlock=(2, 2, 2)) # noqa: F841
self.assertEqual(npf[0, 0, 0], 42.0) self.assertEqual(npf[0, 0, 0], 42)
def testExceptions(self): def testExceptions(self):
"""Check that the right exceptions are thrown when nonexistent or non-convertible fields are accessed""" """Check that the right exceptions are thrown when nonexistent or non-convertible fields are accessed"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment