22 #include "goby/util/binary.h" 23 #include "goby/util/linebasedcomms.h" 29 nmea.push_back(
"$FOOBA");
34 std::cout << nmea.message() << std::endl;
35 assert(nmea.message() ==
"$FOOBA,1,2,3,*75");
40 nmea.push_back(
"$CCTXD");
42 nmea.push_back(
"1,1");
43 nmea.push_back(goby::util::hex_encode(
""));
44 std::cout << nmea.message() << std::endl;
45 assert(nmea.message() ==
"$CCTXD,2,1,1,*7A");
50 assert(nmea.as<
int>(3) == 1);
51 assert(nmea.at(3) ==
"1");
56 std::cout << nmea.message() << std::endl;
57 assert(nmea.at(8) ==
"ROLL");
62 std::cout << nmea.message() << std::endl;
63 assert(nmea.as<
int>(1) == 1);
64 assert(nmea.as<
int>(2) == 1);
67 std::cout <<
"all tests passed" << std::endl;