mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-02 14:08:45 -04:00
More unit tests.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1447 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
parent
0f2a1ac411
commit
fe1311b2c4
@ -107,7 +107,8 @@ setup(void)
|
||||
{
|
||||
TEST(var_cast_to_type);
|
||||
|
||||
AP_Float f(1.0); REQUIRE(f == 1.0);
|
||||
AP_Float f(10.0); REQUIRE(f == 10.0);
|
||||
f = 1.0; REQUIRE(f == 1.0);
|
||||
f *= 2.0; REQUIRE(f == 2.0);
|
||||
f /= 4; REQUIRE(f == 0.5);
|
||||
f += f; REQUIRE(f == 1.0);
|
||||
@ -221,6 +222,20 @@ setup(void)
|
||||
REQUIRE(f1 == 1);
|
||||
}
|
||||
|
||||
// AP_Var: derived types
|
||||
{
|
||||
TEST(var_derived);
|
||||
|
||||
AP_Float16 f1(10.0, 20);
|
||||
|
||||
REQUIRE(f1 == 10.0);
|
||||
f1.save();
|
||||
f1 = 0;
|
||||
REQUIRE(f1 == 0);
|
||||
f1.load();
|
||||
REQUIRE(f1 = 10.0);
|
||||
}
|
||||
|
||||
|
||||
Test::report();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user