add tests for newline handling

This commit is contained in:
Kosma Moczek 2022-06-03 00:44:58 +02:00
parent f75678a426
commit 908846d4f6

View File

@ -18,6 +18,11 @@
static const char *valid_sentences_nochecksum[] = { static const char *valid_sentences_nochecksum[] = {
"$GPTXT,xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "$GPTXT,xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"$GPTXT,hello\n",
"$GPTXT,hello\r",
"$GPTXT,hello\r\n",
"$GPTXT,hello\r\n\r\n",
"$GPTXT,hello\n\r\r\n",
NULL, NULL,
}; };
@ -55,6 +60,9 @@ static const char *invalid_sentences[] = {
"gps: $GPGLL,,,,,,V,N", "gps: $GPGLL,,,,,,V,N",
"$GPXTE,A,A,0.67,L,N*6e", "$GPXTE,A,A,0.67,L,N*6e",
"$GPXTE,A,A,0.67,L,N*6g", "$GPXTE,A,A,0.67,L,N*6g",
"$GPTXT,hello\n ",
"$GPTXT,hello\r*24",
"$GPTXT,hello\r\n$",
NULL, NULL,
}; };