Go to the documentation of this file. 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
void testNavFrameErrorRecovery()
used to assert if error recovery was successfully applied
void testAnswerFrameErrorRecovery()
used to assert if error recovery was successfully applied
void testIsErrorIsThrown(ssize_t cleaned_buffer_size)
used to assert if is error is thrown
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,...
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, 0x0d > MINIMAL_V3_ANS_FRAME
constexpr std::array< uint8_t, 0x25 > MINIMAL_V2_NAV_FRAME
void addNewDataFrame(const T &frame)
Add data using dataset values.
Parser of a STDBIN IXblue message. This is the entry point of the library. Usage of this class is as ...
void testFramesErrorRecovery()
use multiple frame to test error recovery. Add Nav data frame and parse it. Add Answer data frame and...
boost::circular_buffer< uint8_t > internalBuffer