Skip to content

Commit

Permalink
test case
Browse files Browse the repository at this point in the history
  • Loading branch information
shancock884 committed May 1, 2024
1 parent 2a4e37b commit 32182a7
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
40 changes: 40 additions & 0 deletions tests/snapshottests/__snapshots__/test_wlua.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,46 @@
Message CRC: 0x4bdc


''',
})
# ---
# name: test_wlua[common.xml-gps_raw_int.pcapng]
dict({
'returncode': 0,
'stderr': '',
'stdout': '''
Frame 1: 115 bytes on wire (920 bits), 115 bytes captured (920 bits) on
Ethernet II, Src: 00:00:00:00:00:00, Dst: 00:00:00:00:00:00
Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
Transmission Control Protocol, Src Port: 54026, Dst Port: 5760, Seq: 1,
MAVLink Protocol (49)
Header
Magic value / version: MAVLink 2.0 (0xfd)
Payload length: 37
Incompatibility flag: 0x00 (0)
Compatibility flag: 0x00 (0)
Packet sequence: 153
System id: 255
Component id: Unknown (230)
Message id: MISSION_ITEM_INT (73)
Payload: MISSION_ITEM_INT (73)
target_system (uint8_t): 1
target_component (uint8_t): 1
seq (uint16_t): 7
frame (MAV_FRAME): MAV_FRAME_GLOBAL_RELATIVE_ALT (3)
command (MAV_CMD): MAV_CMD_NAV_VTOL_LAND (85)
current (uint8_t): 0
autocontinue (uint8_t): 1
param1: Land Options (NAV_VTOL_LAND_OPTIONS): NAV_VTOL_LAND_OPTI
param2 (float): 0
param3: Approach Altitude (float) m: 0
param4: Yaw (float) deg: 0
x: Latitude (int32_t): 514775152
y: Longitude (int32_t): -25939161
z: Ground Altitude (float) m: 0
Message CRC: 0x4bdc


''',
})
# ---
4 changes: 2 additions & 2 deletions tests/snapshottests/resources/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5042,8 +5042,8 @@
<field type="int32_t" name="lat" units="degE7">Latitude (WGS84, EGM96 ellipsoid)</field>
<field type="int32_t" name="lon" units="degE7">Longitude (WGS84, EGM96 ellipsoid)</field>
<field type="int32_t" name="alt" units="mm">Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude.</field>
<field type="uint16_t" name="eph" invalid="UINT16_MAX">GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX</field>
<field type="uint16_t" name="epv" invalid="UINT16_MAX">GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX</field>
<field type="uint16_t" name="eph" invalid="UINT16_MAX" multiplier="1E-2">GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX</field>
<field type="uint16_t" name="epv" invalid="UINT16_MAX" multiplier="1E-2">GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX</field>
<field type="uint16_t" name="vel" units="cm/s" invalid="UINT16_MAX">GPS ground speed. If unknown, set to: UINT16_MAX</field>
<field type="uint16_t" name="cog" units="cdeg" invalid="UINT16_MAX">Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX</field>
<field type="uint8_t" name="satellites_visible" invalid="UINT8_MAX">Number of satellites visible. If unknown, set to UINT8_MAX</field>
Expand Down
2 changes: 2 additions & 0 deletions tests/snapshottests/test_wlua.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def snapshot(*args, **kwargs):
("common.xml", "gps_global_origin.pcapng"),
# test command specific params in MISSION_ITEM_INT are shown
("common.xml", "mission_item_int.pcapng"),
# test multipliers on eph and epv params of GPS_RAW_INT are handled
("common.xml", "gps_raw_int.pcapng"),
],
)
def test_wlua(request, tmp_path, snapshot, mdef, pcap):
Expand Down

0 comments on commit 32182a7

Please sign in to comment.