1 #ifndef TEST_STD_BIN_DECODER_ERROR_RECOVERY_FEATURE_H 2 #define TEST_STD_BIN_DECODER_ERROR_RECOVERY_FEATURE_H 4 #include <gtest/gtest.h> 8 #include "../datasets/errors/BadCheckSum.h" 9 #include "../datasets/errors/BadNavProtocolVersion.h" 10 #include "../datasets/errors/BadAnswerProtocolVersion.h" 12 #include "../datasets/MinimalV2NavFrame.h" 13 #include "../datasets/MinimalV3AnsFrame.h" 47 ASSERT_THROW(
parseNextFrame(),std::runtime_error) <<
"Exception must be thrown in miss formatted data frame.";
48 EXPECT_EQ(this->
internalBuffer.size(),cleaned_buffer_size) <<
"Buffer must be cleaned.";
62 #endif //TEST_STD_BIN_DECODER_ERROR_RECOVERY_FEATURE_H boost::circular_buffer< uint8_t > internalBuffer
void addNewData(const uint8_t *data, std::size_t length)
Add new binary data to the parser internal buffer The new data can only be a part of a frame...
void testNavFrameErrorRecovery()
used to assert if error recovery was successfully applied
void addNewDataFrame(const T &frame)
Add data using dataset values.
bool parseNextFrame()
Try to parse a frame from the parser internal buffer. Some binary data must have been added with the ...
constexpr std::array< uint8_t, 0x25 > MINIMAL_V2_NAV_FRAME
constexpr std::array< uint8_t, 0x0d > MINIMAL_V3_ANS_FRAME
void testIsErrorIsThrown(ssize_t cleaned_buffer_size)
used to assert if is error is thrown
void testAnswerFrameErrorRecovery()
used to assert if error recovery was successfully applied
void testFramesErrorRecovery()
use multiple frame to test error recovery. Add Nav data frame and parse it. Add Answer data frame and...
Parser of a STDBIN IXblue message. This is the entry point of the library. Usage of this class is as ...