Skip to content

Commit 807396c

Browse files
committed
tests: Edit test_special_array_definition
1 parent bf52c5b commit 807396c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/test_iet.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
from devito.passes.iet.engine import Graph
1717
from devito.passes.iet.languages.C import CDataManager
1818
from devito.symbolics import (Byref, FieldFromComposite, InlineIf, Macro, Class,
19-
String, FLOAT)
19+
FLOAT)
2020
from devito.tools import CustomDtype, as_tuple, dtype_to_ctype
21-
from devito.types import CustomDimension, Array, LocalObject, Symbol
21+
from devito.types import CustomDimension, Array, LocalObject, Symbol, Constant
2222

2323

2424
@pytest.fixture
@@ -505,16 +505,16 @@ def test_codegen_quality0():
505505
assert foo1.parameters[0] is a
506506

507507

508-
# def test_special_array_definition():
508+
def test_special_array_definition():
509509

510-
# class MyArray(Array):
511-
# is_extern = True
512-
# _data_alignment = False
510+
class MyArray(Array):
511+
is_extern = True
512+
_data_alignment = False
513513

514-
# dim = CustomDimension(name='d', symbolic_size=String(''))
515-
# a = MyArray(name='a', dimensions=dim, scope='shared', dtype=np.uint8)
514+
dim = CustomDimension(name='d', symbolic_size=Constant(name='size', value=3.0))
515+
a = MyArray(name='a', dimensions=dim, scope='shared', dtype=np.uint8)
516516

517-
# assert str(Definition(a)) == "extern unsigned char a[];"
517+
assert str(Definition(a)) == "extern unsigned char a[size];"
518518

519519

520520
def test_list_inline():

0 commit comments

Comments
 (0)