diff --git a/docs/changelog.md b/docs/changelog.md index c1104f470..c249be473 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,10 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades +#include + +TEST(GlonassCrcTest, GnssSdrCRCTest) +{ + // test data + std::string string1Real_14_18_00("0000100000111001001001000011101010101100010101001000001001011101010101110011110110101"); + std::string string1Real_14_18_30("0000100000111001001011000011101010101100010101001000001001011101010101110011100001010"); + std::string string1Wrong_14_18_00("0000100000111001001001000011101010101100010101001000001001011101010101110011100001010"); + + auto gnav_msg = Glonass_Gnav_Navigation_Message(); + std::bitset bits; + bits = std::bitset(string1Real_14_18_00); + ASSERT_TRUE(gnav_msg.CRC_test(bits)); + bits = std::bitset(string1Real_14_18_30); + ASSERT_TRUE(gnav_msg.CRC_test(bits)); + bits = std::bitset(string1Wrong_14_18_00); + ASSERT_FALSE(gnav_msg.CRC_test(bits)); +}