Build: update docker build scripts
[marnav.git] / test / nmea / Test_nmea_ttm.cpp
blob1c3d31737755b7489daf28995f3bcd117fc4ad62
1 #include <gtest/gtest.h>
2 #include <marnav/nmea/ttm.hpp>
3 #include <marnav/nmea/nmea.hpp>
4 #include "type_traits_helper.hpp"
6 namespace
9 using namespace marnav;
11 class Test_nmea_ttm : public ::testing::Test
15 TEST_F(Test_nmea_ttm, contruction)
17 EXPECT_NO_THROW(nmea::ttm ttm);
20 TEST_F(Test_nmea_ttm, properties)
22 nmea_sentence_traits<nmea::ttm>();
25 TEST_F(Test_nmea_ttm, parse)
27 auto s = nmea::make_sentence("$GPTTM,,,,,,,,,,,,,*76");
28 ASSERT_NE(nullptr, s);
30 auto ttm = nmea::sentence_cast<nmea::ttm>(s);
31 ASSERT_NE(nullptr, ttm);
34 TEST_F(Test_nmea_ttm, parse_invalid_number_of_arguments)
36 EXPECT_ANY_THROW(
37 nmea::detail::factory::sentence_parse<nmea::ttm>(nmea::talker::none, {12, "@"}));
38 EXPECT_ANY_THROW(
39 nmea::detail::factory::sentence_parse<nmea::ttm>(nmea::talker::none, {16, "@"}));
42 TEST_F(Test_nmea_ttm, empty_to_string)
44 nmea::ttm ttm;
46 EXPECT_STREQ("$GPTTM,,,,,,,,,,,,,*76", nmea::to_string(ttm).c_str());