diff --git a/test_msgs/include/test_msgs/message_fixtures.hpp b/test_msgs/include/test_msgs/message_fixtures.hpp index f2f98e7d..b4679826 100644 --- a/test_msgs/include/test_msgs/message_fixtures.hpp +++ b/test_msgs/include/test_msgs/message_fixtures.hpp @@ -53,7 +53,7 @@ get_messages_primitives() auto msg = std::make_shared(); msg->bool_value = false; msg->byte_value = 0; - msg->char_value = '\0'; + msg->char_value = 0; msg->float32_value = 0.0f; msg->float64_value = 0; msg->int8_value = 0; @@ -71,7 +71,7 @@ get_messages_primitives() auto msg = std::make_shared(); msg->bool_value = true; msg->byte_value = 255; - msg->char_value = '\x7f'; + msg->char_value = 255; msg->float32_value = 1.125f; msg->float64_value = 1.125; msg->int8_value = (std::numeric_limits::max)(); @@ -89,7 +89,7 @@ get_messages_primitives() auto msg = std::make_shared(); msg->bool_value = false; msg->byte_value = 0; - msg->char_value = 0x0; + msg->char_value = 0; msg->float32_value = -2.125f; msg->float64_value = -2.125; msg->int8_value = (std::numeric_limits::min)(); @@ -107,7 +107,7 @@ get_messages_primitives() auto msg = std::make_shared(); msg->bool_value = true; msg->byte_value = 1; - msg->char_value = '\1'; + msg->char_value = 1; msg->float32_value = 1.0f; msg->float64_value = 1; msg->int8_value = 1; @@ -136,7 +136,7 @@ get_messages_static_array_primitives() auto msg = std::make_shared(); msg->bool_values = {{false, true, false}}; msg->byte_values = {{0, 0xff, 0}}; - msg->char_values = {{'\0', '\x7f', '\0'}}; + msg->char_values = {{0, 255, 0}}; msg->float32_values = {{0.0f, 1.125f, -2.125f}}; msg->float64_values = {{0, 1.125, -2.125}}; msg->int8_values = {{ @@ -206,7 +206,7 @@ get_messages_dynamic_array_primitives() auto msg = std::make_shared(); msg->bool_values = {true}; msg->byte_values = {0xff}; - msg->char_values = {'\x7f'}; + msg->char_values = {255}; msg->float32_values = {1.125f}; msg->float64_values = {1.125}; msg->int8_values = {(std::numeric_limits::max)()}; @@ -225,7 +225,7 @@ get_messages_dynamic_array_primitives() auto msg = std::make_shared(); msg->bool_values = {{false, true}}; msg->byte_values = {{0, 0xff}}; - msg->char_values = {{'\0', '\x7f'}}; + msg->char_values = {{0, 255}}; msg->float32_values = {{0.0f, 1.125f, -2.125f}}; msg->float64_values = {{0, 1.125, -2.125}}; msg->int8_values = {{ @@ -271,8 +271,7 @@ get_messages_dynamic_array_primitives() for (size_t i = 0; i < size; ++i) { msg->bool_values[i] = (i % 2 != 0) ? true : false; msg->byte_values[i] = static_cast(i); - // TODO(mikaelarguedas) only ascii chars supported across languages - msg->char_values[i] = static_cast(i % (1 << 7)); + msg->char_values[i] = static_cast(i % (1 << 8)); msg->float32_values[i] = 1.125f * i; msg->float64_values[i] = 1.125 * i; msg->int8_values[i] = static_cast(i); @@ -336,7 +335,7 @@ get_messages_bounded_array_primitives() auto msg = std::make_shared(); msg->bool_values = {{false, true, false}}; msg->byte_values = {{0, 1, 0xff}}; - msg->char_values = {{'\0', '\1', '\x7f'}}; + msg->char_values = {{0, 1, 255}}; msg->float32_values = {{0.0f, 1.125f, -2.125f}}; msg->float64_values = {{0, 1.125, -2.125}}; msg->int8_values = {{ diff --git a/test_msgs/include/test_msgs/service_fixtures.hpp b/test_msgs/include/test_msgs/service_fixtures.hpp index d5db19ae..bd6ff50a 100644 --- a/test_msgs/include/test_msgs/service_fixtures.hpp +++ b/test_msgs/include/test_msgs/service_fixtures.hpp @@ -63,7 +63,7 @@ get_services_primitives() auto request = std::make_shared(); request->bool_value = false; request->byte_value = 0; - request->char_value = '\0'; + request->char_value = 0; request->float32_value = 0.0f; request->float64_value = 0.0; request->int8_value = 0; @@ -78,7 +78,7 @@ get_services_primitives() auto reply = std::make_shared(); reply->bool_value = false; reply->byte_value = 0; - reply->char_value = '\0'; + reply->char_value = 0; reply->float32_value = 0.0f; reply->float64_value = 0.0; reply->int8_value = 0; @@ -96,7 +96,7 @@ get_services_primitives() auto request = std::make_shared(); request->bool_value = true; request->byte_value = 1; - request->char_value = 0x1; + request->char_value = 1; request->float32_value = 1.125f; request->float64_value = 1.11; request->int8_value = 1; @@ -115,7 +115,7 @@ get_services_primitives() auto reply = std::make_shared(); reply->bool_value = true; reply->byte_value = 11; - reply->char_value = 0x11; + reply->char_value = 11; reply->float32_value = 11.125f; reply->float64_value = 11.11; reply->int8_value = 11; diff --git a/test_msgs/src/test_msgs/message_fixtures.py b/test_msgs/src/test_msgs/message_fixtures.py index 5fa870fd..9856dd95 100644 --- a/test_msgs/src/test_msgs/message_fixtures.py +++ b/test_msgs/src/test_msgs/message_fixtures.py @@ -144,7 +144,7 @@ def get_msg_static_array_primitives(): msgs = [] msg = StaticArrayPrimitives() msg.bool_values = [False, True, False] - msg.char_values = ['\0', '\x7f', '\x00'] + msg.char_values = [0, 255, 0] msg.byte_values = [bytes([0]), bytes([255]), bytes([0])] msg.float32_values = [0.0, 1.125, -2.125] msg.float64_values = [0.0, 1.125, -2.125] @@ -207,7 +207,7 @@ def get_msg_dynamic_array_primitives(): msg = DynamicArrayPrimitives() msg.bool_values = [True] msg.byte_values = [bytes([255])] - msg.char_values = ['\x7f'] + msg.char_values = [255] msg.float32_values = [1.125] msg.float64_values = [1.125] msg.int8_values = [127] @@ -225,7 +225,7 @@ def get_msg_dynamic_array_primitives(): msg = DynamicArrayPrimitives() msg.bool_values = [False, True] msg.byte_values = [bytes([0]), bytes([255])] - msg.char_values = ['\0', '\x7f'] + msg.char_values = [0, 255] msg.float32_values = [0.0, 1.125, -2.125] msg.float64_values = [0.0, 1.125, -2.125] msg.int8_values = [0, 127, -128] @@ -245,8 +245,7 @@ def get_msg_dynamic_array_primitives(): msg = DynamicArrayPrimitives() msg.bool_values = [i % 2 != 0 for i in range(size)] msg.byte_values = [bytes([i % (1 << 8)]) for i in range(size)] - # TODO(mikaelarguedas) only ascii chars supported across languages - msg.char_values = [chr(i % (1 << 7)) for i in range(size)] + msg.char_values = [i % (1 << 8) for i in range(size)] msg.float32_values = [float(1.125 * i) for i in range(size)] msg.float64_values = [1.125 * i for i in range(size)] msg.int8_values = [int_from_uint(i, 8) for i in range(size)] @@ -302,7 +301,7 @@ def get_msg_bounded_array_primitives(): msg = BoundedArrayPrimitives() msg.bool_values = [False, True, False] msg.byte_values = [bytes([0]), bytes([1]), bytes([255])] - msg.char_values = ['\0', '\1', '\x7f'] + msg.char_values = [0, 1, 255] msg.float32_values = [0.0, 1.125, -2.125] msg.float64_values = [0.0, 1.125, -2.125] msg.int8_values = [0, 127, -128] diff --git a/test_msgs/src/test_msgs/service_fixtures.py b/test_msgs/src/test_msgs/service_fixtures.py index 56c2f47c..e6c16a4b 100644 --- a/test_msgs/src/test_msgs/service_fixtures.py +++ b/test_msgs/src/test_msgs/service_fixtures.py @@ -28,7 +28,7 @@ def get_msg_primitives(): req = Primitives.Request() req.bool_value = False req.byte_value = bytes([0]) - req.char_value = '\x00' + req.char_value = 0 req.float32_value = float(0.0) req.float64_value = float(0.0) req.int8_value = 0 @@ -43,7 +43,7 @@ def get_msg_primitives(): resp = Primitives.Response() resp.bool_value = False resp.byte_value = bytes([0]) - resp.char_value = '\x00' + resp.char_value = 0 resp.float32_value = float(0.0) resp.float64_value = float(0.0) resp.int8_value = 0 @@ -60,7 +60,7 @@ def get_msg_primitives(): req = Primitives.Request() req.bool_value = True req.byte_value = bytes([1]) - req.char_value = '\x01' + req.char_value = 1 req.float32_value = float(1.125) req.float64_value = float(1.11) req.int8_value = 1 @@ -78,7 +78,7 @@ def get_msg_primitives(): resp = Primitives.Response() resp.bool_value = True resp.byte_value = bytes([11]) - resp.char_value = '\x11' + resp.char_value = 11 resp.float32_value = float(11.125) resp.float64_value = float(11.11) resp.int8_value = 11