roslaunch: #2728 remap validator now checks for empty string
This commit is contained in:
parent
13ee49b4a0
commit
41c8d77ad1
|
@ -836,7 +836,9 @@ class TestXmlLoader(unittest.TestCase):
|
|||
|
||||
def test_remap_invalid(self):
|
||||
tests = ['test-remap-invalid-1.xml',
|
||||
'test-remap-invalid-2.xml',
|
||||
'test-remap-invalid-2.xml',
|
||||
'test-remap-invalid-3.xml',
|
||||
'test-remap-invalid-4.xml',
|
||||
'test-remap-invalid-name-from.xml',
|
||||
'test-remap-invalid-name-to.xml',
|
||||
]
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
<launch>
|
||||
<!-- to is empty-->
|
||||
<remap from="from" to="" />
|
||||
</launch>
|
|
@ -0,0 +1,4 @@
|
|||
<launch>
|
||||
<!-- from is empty -->
|
||||
<remap from="" to="to" />
|
||||
</launch>
|
|
@ -205,6 +205,8 @@ class LoaderContext(object):
|
|||
@type remap: (str, str)
|
||||
"""
|
||||
remap = [canonicalize_name(x) for x in remap]
|
||||
if not remap[0] or not remap[1]:
|
||||
raise RLException("remap from/to attributes cannot be empty")
|
||||
if not is_legal_name(remap[0]):
|
||||
raise RLException("remap from [%s] is not a valid ROS name"%remap[0])
|
||||
if not is_legal_name(remap[1]):
|
||||
|
|
Loading…
Reference in New Issue