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