From 22e3a431223acc99d18395a99da93b1db9636765 Mon Sep 17 00:00:00 2001 From: ChrisTimperley Date: Fri, 22 Nov 2019 18:28:41 -0500 Subject: [PATCH 1/2] added regression test for #320 --- test/test_type_database.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/test_type_database.py b/test/test_type_database.py index 6979111a4..dd12747ea 100644 --- a/test/test_type_database.py +++ b/test/test_type_database.py @@ -141,3 +141,20 @@ def check(name: str, md5sum_expected: str) -> None: check('mavros_msgs/State', '9e3d873fae342c8f48a8bd64c53d991e') check('mavros_msgs/Mavlink', '6dd71a38b8541fdc2de89a548c7dbc2f') check('rosgraph_msgs/Log', 'acffd30cd6b6de30f120938c17c593fb') + + +def test_encode_and_decode(): + db_type = load_mavros_type_db() + Waypoint = db_type['Waypoint'] + wp = Waypoint(frame=3, + command=82, + is_current=False, + autocontinue=True, + param1=2.545384369178356, + param2=0.0, + param3=0.0, + param4=0.0, + x_lat=-35.36326497378809, + y_long=149.1652387253908, + z_alt=3.45551165104657) + assert wp == Waypoint.decode(wp.encode()) From ebd4a220d09564118b6e061fa9ae89cedd4b4468 Mon Sep 17 00:00:00 2001 From: ChrisTimperley Date: Fri, 22 Nov 2019 18:30:47 -0500 Subject: [PATCH 2/2] bug fix: incorrect type name --- test/test_type_database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_type_database.py b/test/test_type_database.py index dd12747ea..f52aba702 100644 --- a/test/test_type_database.py +++ b/test/test_type_database.py @@ -145,7 +145,7 @@ def check(name: str, md5sum_expected: str) -> None: def test_encode_and_decode(): db_type = load_mavros_type_db() - Waypoint = db_type['Waypoint'] + Waypoint = db_type['mavros_msgs/Waypoint'] wp = Waypoint(frame=3, command=82, is_current=False,