Skip to content

Commit 30624df

Browse files
committed
iMultiFab Unit Tests
1 parent 27b9c5e commit 30624df

File tree

2 files changed

+504
-0
lines changed

2 files changed

+504
-0
lines changed

tests/conftest.py

+18
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,21 @@ def __exit__(self, exc_type, exc_value, traceback):
138138

139139
with MfabDeviceContextManager() as mfab:
140140
yield mfab
141+
142+
143+
@pytest.fixture(scope="function", params=list(itertools.product([1, 3], [0, 1])))
144+
def imfab(boxarr, distmap, request):
145+
class iMfabContextManager:
146+
def __enter__(self):
147+
num_components = request.param[0]
148+
num_ghost = request.param[1]
149+
self.imfab = amr.iMultiFab(boxarr, distmap, num_components, num_ghost)
150+
self.imfab.set_val(0, 0, num_components)
151+
return self.imfab
152+
153+
def __exit__(self, exc_type, exc_value, traceback):
154+
self.imfab.clear()
155+
del self.imfab
156+
157+
with iMfabContextManager() as imfab:
158+
yield imfab

0 commit comments

Comments
 (0)