mirror of https://github.com/ArduPilot/ardupilot
AP_JSButton: add unittest
This commit is contained in:
parent
d0f06beeaa
commit
95c345e6fb
|
@ -0,0 +1,16 @@
|
|||
#include <AP_gtest.h>
|
||||
#include <AP_JSButton/AP_JSButton.h>
|
||||
|
||||
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
||||
|
||||
TEST(JSButtonTest, Test)
|
||||
{
|
||||
JSButton jsbutton;
|
||||
EXPECT_EQ(jsbutton.function(), JSButton::k_none);
|
||||
EXPECT_EQ(jsbutton.function(true), JSButton::k_none);
|
||||
jsbutton.set_default(JSButton::k_shift, JSButton::k_arm_toggle);
|
||||
EXPECT_EQ(jsbutton.function(), JSButton::k_shift);
|
||||
EXPECT_EQ(jsbutton.function(true), JSButton::k_arm_toggle);
|
||||
}
|
||||
|
||||
AP_GTEST_MAIN()
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
def build(bld):
|
||||
bld.ap_find_tests(
|
||||
use='ap',
|
||||
)
|
Loading…
Reference in New Issue