Skip to content

Commit

Permalink
Combine constant tests in a loop
Browse files Browse the repository at this point in the history
Co-authored-by: Henry Moore <[email protected]>
Signed-off-by: Ryan <[email protected]>
  • Loading branch information
2 people authored and Ryan Friedman committed Sep 7, 2024
1 parent 46f608f commit 65140bd
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions rosidl_adapter/test/test_constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,9 @@ def test_constant_constructor():
Constant('bool', 'FOO', None)

# NaN is case insensitive in python, so test a few variations.
value = Constant('float32', 'FOO', 'nan')
value = Constant('float32', 'FOO', 'Nan')
value = Constant('float32', 'FOO', 'NaN')
value = Constant('float32', 'FOO', 'NAN')
value = Constant('float64', 'FOO', 'nan')
value = Constant('float64', 'FOO', 'Nan')
value = Constant('float64', 'FOO', 'NaN')
value = Constant('float64', 'FOO', 'NAN')
for nan_string in ['nan','Nan','NaN','NAN','nan','Nan','NaN','NAN']:
value = Constant('float32', 'FOO', nan_string)
assert isnan(value.value)


def test_constant_methods():
Expand Down

0 comments on commit 65140bd

Please sign in to comment.