Skip to content

Commit 2c3ca51

Browse files
committed
Flag within our list_rdm_tests tool if the WithExtraData tests are likely to be redundant due to a PID's maximum data size already being at the max PDL
(cherry picked from commit 372edee)
1 parent fceba6c commit 2c3ca51

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

tools/rdm/list_rdm_tests.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import textwrap
2626

2727
from ola import PidStore
28+
from ola.RDMConstants import RDM_MAX_PARAM_DATA_LENGTH
2829

2930
__author__ = 'Peter Newman'
3031

@@ -152,20 +153,22 @@ def GetWithExtraData(names, pid, pid_test_base_name, get_size):
152153
print(' """GET %s with more than %d byte%s of data."""' %
153154
(pid.name, get_size, 's' if get_size > 1 else ''))
154155
print(' PID = \'%s\'' % (pid.name))
156+
if get_size >= RDM_MAX_PARAM_DATA_LENGTH:
157+
print((" # TODO(%s): Should we even have this test, get_size is "
158+
"already at least the max PDL!") % (getpass.getuser()))
155159
dummy_data = GenerateDummyData(get_size)
156160
if dummy_data is None:
157161
print((" # DATA = b'foo' # TODO(%s): Specify extra data if this isn't "
158162
"enough.") % (getpass.getuser()))
159-
print(" # Ensure the first %d bytes are sane/valid." % (get_size))
160163
elif dummy_data != 'foo':
161164
# Doesn't match default, explicitly set value
162165
print((" DATA = b'%s' # TODO(%s): Specify extra data if this isn't "
163166
"enough.") % (dummy_data, getpass.getuser()))
164-
print(" # Ensure the first %d bytes are sane/valid." % (get_size))
165167
else:
166168
print((" # DATA = b'%s' # TODO(%s): Specify extra data if this isn't "
167169
"enough.") % (dummy_data, getpass.getuser()))
168-
print(" # Ensure the first %d bytes are sane/valid." % (get_size))
170+
171+
print(" # Ensure the first %d bytes are sane/valid." % (get_size))
169172
print('')
170173
print('')
171174

@@ -279,20 +282,22 @@ def SetWithExtraData(names, pid, pid_test_base_name, set_size):
279282
'OptionalParameterTestFixture'])
280283
print(' """Send a SET %s command with extra data."""' % (pid.name))
281284
print(' PID = \'%s\'' % (pid.name))
285+
if set_size >= RDM_MAX_PARAM_DATA_LENGTH:
286+
print((" # TODO(%s): Should we even have this test, set_size is "
287+
"already at least the max PDL!") % (getpass.getuser()))
282288
dummy_data = GenerateDummyData(set_size)
283289
if dummy_data is None:
284290
print((" # DATA = b'foo' # TODO(%s): Specify extra data if this isn't "
285291
"enough.") % (getpass.getuser()))
286-
print(" # Ensure the first %d bytes are sane/valid." % (set_size))
287292
elif dummy_data != 'foo':
288293
# Doesn't match default, explicitly set value
289294
print((" DATA = b'%s' # TODO(%s): Specify extra data if this isn't "
290295
"enough.") % (dummy_data, getpass.getuser()))
291-
print(" # Ensure the first %d bytes are sane/valid." % (set_size))
292296
else:
293297
print((" # DATA = b'%s' # TODO(%s): Specify extra data if this isn't "
294298
"enough.") % (dummy_data, getpass.getuser()))
295-
print(" # Ensure the first %d bytes are sane/valid." % (set_size))
299+
300+
print(" # Ensure the first %d bytes are sane/valid." % (set_size))
296301
print('')
297302
print('')
298303

0 commit comments

Comments
 (0)