From 9447cce4f053be06363d6a8d2c54ef78de60f2d9 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 20 Jan 2021 14:56:26 +0100 Subject: [PATCH] Remove no longer used function 'isChecksumToken' (#32) --- extras/test/src/test_checksum.cpp | 12 ------------ src/nmea/util/checksum.cpp | 5 ----- src/nmea/util/checksum.h | 3 +-- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/extras/test/src/test_checksum.cpp b/extras/test/src/test_checksum.cpp index 7506c1e..4eac215 100644 --- a/extras/test/src/test_checksum.cpp +++ b/extras/test/src/test_checksum.cpp @@ -37,15 +37,3 @@ TEST_CASE("NMEA message with invalid checksum", "[checksum-03]") std::string const GPRMC_CHECKSUM_ERROR = "$GPRMC,062101.714,A,5001.869,N,01912.114,E,955535.7,116.2,290520,000.0,W*FF\r\n"; REQUIRE(nmea::util::isChecksumOk(GPRMC_CHECKSUM_ERROR.c_str()) == false); } - -TEST_CASE("Test isChecksumToken(...) with valid checksum token", "[checksum-04]") -{ - std::string const VALID_CHECKSUM_TOKEN = "W*FF"; - REQUIRE(nmea::util::isChecksumToken(VALID_CHECKSUM_TOKEN.c_str()) == true); -} - -TEST_CASE("Test isChecksumToken(...) with invalid checksum token", "[checksum-04]") -{ - std::string const INVALID_CHECKSUM_TOKEN = "01912.114"; - REQUIRE(nmea::util::isChecksumToken(INVALID_CHECKSUM_TOKEN.c_str()) == false); -} diff --git a/src/nmea/util/checksum.cpp b/src/nmea/util/checksum.cpp index 6d0cc4f..97a49a7 100644 --- a/src/nmea/util/checksum.cpp +++ b/src/nmea/util/checksum.cpp @@ -49,11 +49,6 @@ bool isChecksumOk(char const * const nmea_str) return (calcChecksum(nmea_str) == extractChecksum(nmea_str)); } -bool isChecksumToken(char const * token) -{ - return (strchr(token, '*') != nullptr); -} - /************************************************************************************** * INTERNAL FUNCTION DEFINITION **************************************************************************************/ diff --git a/src/nmea/util/checksum.h b/src/nmea/util/checksum.h index e1bf8bf..fc0fb77 100644 --- a/src/nmea/util/checksum.h +++ b/src/nmea/util/checksum.h @@ -22,8 +22,7 @@ namespace util * FUNCTION DECLARATION **************************************************************************************/ -bool isChecksumOk (char const * const nmea_str); -bool isChecksumToken(char const * token); +bool isChecksumOk(char const * const nmea_str); /************************************************************************************** * NAMESPACE