NMEA: make nmeatool available with/without ENABLE_IO
[marnav.git] / test / nmea / Test_nmea_angle.cpp
blob7afc3a98bb8e6e22bcb83d77dafbc162f74b02da
1 #include <marnav/nmea/angle.hpp>
2 #include <gtest/gtest.h>
4 namespace
7 class Test_nmea_angle : public ::testing::Test
9 };
11 TEST_F(Test_nmea_angle, parse_empty_string)
13 const auto expected = marnav::geo::angle{0.0};
15 auto result = marnav::nmea::parse_latitude("");
17 EXPECT_DOUBLE_EQ(expected, result);
20 TEST_F(Test_nmea_angle, parse_invalid_string)
22 EXPECT_ANY_THROW(marnav::nmea::parse_latitude("001.abcdefgh"));
25 TEST_F(Test_nmea_angle, parse_invalid_minutes)
27 EXPECT_ANY_THROW(marnav::nmea::parse_latitude("00161.000"));