static void TestRelativeAltitude() { TCHAR buffer[256]; // Test FormatRelativeAltitude() FormatRelativeAltitude(buffer, 1234, Unit::METER); ok1(StringIsEqual(buffer, _T("+1234 m"))); FormatRelativeAltitude(buffer, Units::ToSysUnit(1234, Unit::FEET), Unit::FEET); ok1(StringIsEqual(buffer, _T("+1234 ft"))); FormatRelativeAltitude(buffer, -1234, Unit::METER); ok1(StringIsEqual(buffer, _T("-1234 m"))); FormatRelativeAltitude(buffer, Units::ToSysUnit(-1234, Unit::FEET), Unit::FEET); ok1(StringIsEqual(buffer, _T("-1234 ft"))); FormatRelativeAltitude(buffer, 1234, Unit::METER, false); ok1(StringIsEqual(buffer, _T("+1234"))); FormatRelativeAltitude(buffer, -1234, Unit::METER, false); ok1(StringIsEqual(buffer, _T("-1234"))); }
void FormatRelativeUserAltitude(fixed value, TCHAR *buffer, bool include_unit) { FormatRelativeAltitude(buffer, value, Units::GetUserAltitudeUnit(), include_unit); }