File tree Expand file tree Collapse file tree 4 files changed +20
-1
lines changed
Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ if(BUILD_TESTING)
5656 rosidl_generate_interfaces(${PROJECT_NAME} _custom
5757 ${test_interface_files_MSG_FILES}
5858 # Cases not covered by test_interface_files
59+ msg/BuiltinTypeSequencesIdl.idl
5960 msg/StringArrays.msg
6061 msg/Property.msg
6162 ADD_LINTER_TESTS
Original file line number Diff line number Diff line change 1+ module rosidl_generator_py {
2+ module msg {
3+ struct BuiltinTypeSequencesIdl {
4+ // Unbounded sequences
5+ sequence<char> char_sequence_unbounded;
6+ };
7+ };
8+ };
Original file line number Diff line number Diff line change @@ -498,7 +498,7 @@ bound = 2**nbits
498498 all (val >= 0 and val < @ (bound) for val in value)), \
499499@ {assert_msg_suffixes .append (' and each unsigned integer in [0, %d]' % (bound - 1 ))}@
500500@ [ elif isinstance (type_, BasicType) and type_ .typename == ' char' ]@
501- all (val >= 0 and val) < 256 for val in value)), \
501+ all (ord ( val) >= 0 and ord ( val) < 256 for val in value)), \
502502@ {assert_msg_suffixes .append (' and each char in [0, 255]' )}@
503503@ [ elif isinstance (type_, BasicType) and type_ .typename in FLOATING_POINT_TYPES]@
504504@ [ if type_ .typename == " float" ]@
Original file line number Diff line number Diff line change 2020from rosidl_generator_py .msg import Arrays
2121from rosidl_generator_py .msg import BasicTypes
2222from rosidl_generator_py .msg import BoundedSequences
23+ from rosidl_generator_py .msg import BuiltinTypeSequencesIdl
2324from rosidl_generator_py .msg import Constants
2425from rosidl_generator_py .msg import Defaults
2526from rosidl_generator_py .msg import Nested
@@ -916,3 +917,12 @@ def test_string_slot_types():
916917 assert isinstance (string_slot_types [4 ], Array )
917918 assert isinstance (string_slot_types [4 ].value_type , UnboundedString )
918919 assert string_slot_types [4 ].size == 3
920+
921+
922+ def test_builtin_sequence_slot_attributes ():
923+ msg = BuiltinTypeSequencesIdl ()
924+ assert hasattr (msg , 'get_fields_and_field_types' )
925+ assert hasattr (msg , '__slots__' )
926+ builtin_sequence_slot_types_dict = getattr (msg , 'get_fields_and_field_types' )()
927+ builtin_sequence_slots = getattr (msg , '__slots__' )
928+ assert len (builtin_sequence_slot_types_dict ) == len (builtin_sequence_slots )
You can’t perform that action at this time.
0 commit comments