Merge pull request #60 from kosma/cmm_test_fixes

tests.c - Fix 'format-security' warnings due to use of ck_assert_msg(…
This commit is contained in:
Kosma Moczek 2022-05-20 14:57:15 +02:00 committed by GitHub
commit 7689f93e73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

12
tests.c
View File

@ -76,18 +76,18 @@ END_TEST
START_TEST(test_minmea_check) START_TEST(test_minmea_check)
{ {
for (const char **sentence=valid_sentences_nochecksum; *sentence; sentence++) { for (const char **sentence=valid_sentences_nochecksum; *sentence; sentence++) {
ck_assert_msg(minmea_check(*sentence, false) == true, *sentence); ck_assert_msg(minmea_check(*sentence, false) == true, "%s", *sentence);
ck_assert_msg(minmea_check(*sentence, true) == false, *sentence); ck_assert_msg(minmea_check(*sentence, true) == false, "%s", *sentence);
} }
for (const char **sentence=valid_sentences_checksum; *sentence; sentence++) { for (const char **sentence=valid_sentences_checksum; *sentence; sentence++) {
ck_assert_msg(minmea_check(*sentence, false) == true, *sentence); ck_assert_msg(minmea_check(*sentence, false) == true, "%s", *sentence);
ck_assert_msg(minmea_check(*sentence, true) == true, *sentence); ck_assert_msg(minmea_check(*sentence, true) == true, "%s", *sentence);
} }
for (const char **sentence=invalid_sentences; *sentence; sentence++) { for (const char **sentence=invalid_sentences; *sentence; sentence++) {
ck_assert_msg(minmea_check(*sentence, false) == false, *sentence); ck_assert_msg(minmea_check(*sentence, false) == false, "%s", *sentence);
ck_assert_msg(minmea_check(*sentence, true) == false, *sentence); ck_assert_msg(minmea_check(*sentence, true) == false, "%s", *sentence);
} }
} }
END_TEST END_TEST