1 #include <marnav/nmea/checksum.hpp>
2 #include <gtest/gtest.h>
6 using namespace marnav
;
8 class Test_nmea_checksum
: public ::testing::Test
12 TEST_F(Test_nmea_checksum
, checksum_error_construction
)
14 EXPECT_NO_THROW(nmea::checksum_error
e(0x12, 0x34));
17 TEST_F(Test_nmea_checksum
, checksum_compute_sum
)
24 const std::vector
<test_case
> cases
{
25 {0x01u
, "0123456789"},
26 {0x1bu
, "abcdefghijklmnopqrstuvwxyz"},
27 {0x1bu
, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"},
30 for (auto const & test
: cases
) {
31 EXPECT_EQ(test
.sum
, nmea::checksum(begin(test
.s
), end(test
.s
)));