Ardupilot2/libraries/AP_GSOF/tests/test_gsof.cpp
Ryan Friedman 921ef6cd36 AP_GSOF: factor out common library for GSOF
* Add tests too

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2024-08-20 14:50:05 +10:00

27 lines
614 B
C++

// Tests for the GSOF parser.
// * ./waf tests
// * ./build/sitl/tests/test_gsof
#include <AP_gtest.h>
#include <AP_GSOF/AP_GSOF.h>
const AP_HAL::HAL &hal = AP_HAL::get_HAL();
TEST(AP_GSOF, incomplete_packet)
{
AP_GSOF gsof;
EXPECT_FALSE(gsof.parse(0));
}
TEST(AP_GSOF, packet1)
{
// 02084072580000010a1e02e0680909009400000218000000000000000000000000000000000000000000000000080d000000000000000000000000000910000000000000000000000000000000000c260000000000000000000000000000000000000000000000000000000000000000000000000000a503
AP_GSOF gsof;
EXPECT_FALSE(gsof.parse(0));
}
AP_GTEST_MAIN()