Skip to content

Commit 40540d5

Browse files
committed
Added few more tests to improve coverage.
1 parent 51352bc commit 40540d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/utils/test_directives.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ def test_line_contains_openacc_directive():
2727
assert not line_contains_openacc_directive(f90_code, Cxx())
2828
assert line_contains_openacc_directive(f90_code, Fortran())
2929
assert not line_contains_openacc_directive(cxx_code, Fortran())
30+
assert not line_contains_openacc_directive(cxx_code, None)
3031

3132

3233
def test_line_contains_openacc_parallel_directive():
3334
assert line_contains_openacc_parallel_directive("#pragma acc parallel wait", Cxx())
3435
assert line_contains_openacc_parallel_directive("!$acc parallel", Fortran())
3536
assert not line_contains_openacc_parallel_directive("#pragma acc loop", Cxx())
3637
assert not line_contains_openacc_parallel_directive("!$acc loop", Fortran())
38+
assert not line_contains_openacc_parallel_directive("!$acc parallel", None)
3739

3840

3941
def test_openacc_pragma_contains_data_clause():
@@ -50,11 +52,13 @@ def test_create_data_directive():
5052
create_data_directive_openacc("matrix", 35, Fortran())
5153
== "!$acc enter data create(matrix(:35))\n!$acc update device(matrix(:35))\n"
5254
)
55+
assert create_data_directive_openacc("array", 1024, None) == ""
5356

5457

5558
def test_exit_data_directive():
5659
assert exit_data_directive_openacc("array", 1024, Cxx()) == "#pragma acc exit data copyout(array[:1024])\n"
5760
assert exit_data_directive_openacc("matrix", 35, Fortran()) == "!$acc exit data copyout(matrix(:35))\n"
61+
assert exit_data_directive_openacc("matrix", 1024, None) == ""
5862

5963

6064
def test_correct_kernel():

0 commit comments

Comments
 (0)