From edafe97d7ac33203c4d81386f0d9a7b6249766db Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Thu, 21 Jan 2021 07:11:46 +0100 Subject: [PATCH] Adding test code to cause segmentation violation. --- extras/test/src/test_ArduinoNmeaParser.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extras/test/src/test_ArduinoNmeaParser.cpp b/extras/test/src/test_ArduinoNmeaParser.cpp index 2a8fa27..9074a7c 100644 --- a/extras/test/src/test_ArduinoNmeaParser.cpp +++ b/extras/test/src/test_ArduinoNmeaParser.cpp @@ -238,3 +238,10 @@ TEST_CASE("Multiple NMEA messages received", "[Parser-06]") REQUIRE(parser.error() == ArduinoNmeaParser::Error::None); } + +TEST_CASE("NMEA message with no checksum received", "[Parser-07]") +{ + ArduinoNmeaParser parser(nullptr, nullptr); + std::string const GPRMC = "79\r\n"; /* This should not lead to a segmentation violation. */ + encode(parser, GPRMC); +}