|
24 | 24 | import sys |
25 | 25 | import textwrap |
26 | 26 |
|
| 27 | +from ola.RDMConstants import RDM_MAX_PARAM_DATA_LENGTH |
| 28 | + |
27 | 29 | from ola import PidStore |
28 | 30 |
|
29 | 31 | __author__ = 'Peter Newman' |
@@ -152,20 +154,22 @@ def GetWithExtraData(names, pid, pid_test_base_name, get_size): |
152 | 154 | print(' """GET %s with more than %d byte%s of data."""' % |
153 | 155 | (pid.name, get_size, 's' if get_size > 1 else '')) |
154 | 156 | print(' PID = \'%s\'' % (pid.name)) |
| 157 | + if get_size >= RDM_MAX_PARAM_DATA_LENGTH: |
| 158 | + print((" # TODO(%s): Should we even have this test, get_size is " |
| 159 | + "already at least the max PDL!") % (getpass.getuser())) |
155 | 160 | dummy_data = GenerateDummyData(get_size) |
156 | 161 | if dummy_data is None: |
157 | 162 | print((" # DATA = b'foo' # TODO(%s): Specify extra data if this isn't " |
158 | 163 | "enough.") % (getpass.getuser())) |
159 | | - print(" # Ensure the first %d bytes are sane/valid." % (get_size)) |
160 | 164 | elif dummy_data != 'foo': |
161 | 165 | # Doesn't match default, explicitly set value |
162 | 166 | print((" DATA = b'%s' # TODO(%s): Specify extra data if this isn't " |
163 | 167 | "enough.") % (dummy_data, getpass.getuser())) |
164 | | - print(" # Ensure the first %d bytes are sane/valid." % (get_size)) |
165 | 168 | else: |
166 | 169 | print((" # DATA = b'%s' # TODO(%s): Specify extra data if this isn't " |
167 | 170 | "enough.") % (dummy_data, getpass.getuser())) |
168 | | - print(" # Ensure the first %d bytes are sane/valid." % (get_size)) |
| 171 | + |
| 172 | + print(" # Ensure the first %d bytes are sane/valid." % (get_size)) |
169 | 173 | print('') |
170 | 174 | print('') |
171 | 175 |
|
@@ -279,20 +283,22 @@ def SetWithExtraData(names, pid, pid_test_base_name, set_size): |
279 | 283 | 'OptionalParameterTestFixture']) |
280 | 284 | print(' """Send a SET %s command with extra data."""' % (pid.name)) |
281 | 285 | print(' PID = \'%s\'' % (pid.name)) |
| 286 | + if set_size >= RDM_MAX_PARAM_DATA_LENGTH: |
| 287 | + print((" # TODO(%s): Should we even have this test, set_size is " |
| 288 | + "already at least the max PDL!") % (getpass.getuser())) |
282 | 289 | dummy_data = GenerateDummyData(set_size) |
283 | 290 | if dummy_data is None: |
284 | 291 | print((" # DATA = b'foo' # TODO(%s): Specify extra data if this isn't " |
285 | 292 | "enough.") % (getpass.getuser())) |
286 | | - print(" # Ensure the first %d bytes are sane/valid." % (set_size)) |
287 | 293 | elif dummy_data != 'foo': |
288 | 294 | # Doesn't match default, explicitly set value |
289 | 295 | print((" DATA = b'%s' # TODO(%s): Specify extra data if this isn't " |
290 | 296 | "enough.") % (dummy_data, getpass.getuser())) |
291 | | - print(" # Ensure the first %d bytes are sane/valid." % (set_size)) |
292 | 297 | else: |
293 | 298 | print((" # DATA = b'%s' # TODO(%s): Specify extra data if this isn't " |
294 | 299 | "enough.") % (dummy_data, getpass.getuser())) |
295 | | - print(" # Ensure the first %d bytes are sane/valid." % (set_size)) |
| 300 | + |
| 301 | + print(" # Ensure the first %d bytes are sane/valid." % (set_size)) |
296 | 302 | print('') |
297 | 303 | print('') |
298 | 304 |
|
|
0 commit comments