1#include <gtest/gtest.h>
11 o.writer().set([](
const std::string& s) ->
void {
write(s); });
12 o.reader().set([](std::string& s) ->
void {
read(s); });
13 o.resetter().set([
this]() ->
void {
reset(); });
16 static void write(
const std::string& s) {
18 static void read(std::string& s) {
30 std::array<std::string, NMEA_MAX_REPLIES>
replies;
37 reply =
"XXXTST\r\nXXXTST\r\ntestcommand\r\n";
38 EXPECT_TRUE(test_parse_multiline_reply(command));
40 EXPECT_STREQ(
replies[0].c_str(),
"XXXTST\r\n");
41 EXPECT_STREQ(
replies[1].c_str(),
"XXXTST\r\n");
46 reply =
"XXXTST\r\ntestcommand\r\n";
47 EXPECT_TRUE(test_parse_multiline_reply(command));
49 EXPECT_STREQ(
replies[0].c_str(),
"XXXTST\r\n");
53 EXPECT_TRUE(o.writer().is_set());
54 EXPECT_TRUE(o.reader().is_set());
55 EXPECT_TRUE(o.resetter().is_set());
59 EXPECT_FALSE(is_reset_called);
61 EXPECT_TRUE(is_reset_called);
Driver class for ST Teseo IC.
static void write(const std::string &s)
bool test_parse_multiline_reply(const teseo::nmea_rr &command)
static void read(std::string &s)
std::array< std::string, NMEA_MAX_REPLIES > replies
const std::pair< const std::string, const std::string > nmea_rr
std::array< std::string, NMEA_MAX_REPLIES > replies
const size_t NMEA_MAX_REPLIES
TEST_F(teseoTest, parseMultilineReply)